You are given a matrix. The matrix elements are such that they are sorted both horizonTALLY and vertically. Given an element of the matrix, your job is to obtain its position in an efficient manner.Example: 10 20 30 15 35 98 48 76 110input: 76output: 3rd row, 2nd column.
I assume you can do it in the following way: "python class Coordinate: def __init__(self,x=0,y=0): self.x = x self.y = y def findElement(a,n): if a == Non...
I think it can be solved in a two dimensional Binary-Search way