74. Search a 2D Matrix

74. Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo…

367. Valid Perfect Square

367. Valid Perfect Square

Given a positive integer num, write a function which returns True if num is a perfect square else Fa…

374. Guess Number Higher or Lower

374. Guess Number Higher or Lower

We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues…

278. First Bad Version

278. First Bad Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the …

69. Sqrt(x)

69. Sqrt(x)

Implement int sqrt(int x). Compute and return the square root of x. 思路: 这道题不难,用binary search 1-x就行,有…

返回顶部