Question: def get_row(n_row: int, m: int) -> str: This function returns only the characters in the game board found at the given row in the same
def get_row(n_row: int, m: int) -> str: """This function returns only the characters in the game board found at the given row in the same left-to-right order as they appear in the row. >>>get_row(1,4) "0,1,2,3," >>>get_row(2,3) "3,4,5" """ return
how to finish this function?(this is a n*m rectangle)the rectangle at first row, first column is always 0. n_row means the nth row.for example, if n_rows=2,m=3 we pick the second row, and list the number in second row which is '3,4,5'. if n=1, m=2, function should return '0,1'.if n=2,m=2, fucntion should return'2,3'.
the number in each point base on row and col with the formula (row - 1) * N_COLUMNS + (col - 1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
