title: Is there a way to input values to a 2D array with O(n) time complexity?
body: <p>There is a very common method to input values to a 2D square matrix... using two for loops... Now is there a way to input values to a 2D array with O(n) time complexity?</p>