Search a Number in a Matrix (Sorted Rows)| Coding Interview | Searching

This problem is based on a matrix and is kind of easy if you are already familiar with Binary search. It has been asked by Amazon, Facebook, Microsoft, and Apple.
To better grasp the problem, try to code the solution yourself. If you get stuck at any point, I have provided the solution and its code explanation.