LeetCode | 刷题日志
-
507. Perfect Number
We define the Perfect Number is a positive integer that is equal to the sum of all its positive divi…
-
172. Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in log…
-
171. Excel Sheet Column Number
Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, retur…
-
633. Sum of Square Numbers
Given a non-negative integer c, your task is to decide whether there’re two integers a and b s…
-
598. Range Addition II
Given an m * n matrix M initialized with all 0‘s and several update operations. Operations are…
-
326. Power of Three
Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it…
-
475. Heaters
Winter is coming! Your first job during the contest is to design a standard heater with fixed warm r…
-
240. Search a 2D Matrix II
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo…
-
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
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
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
You are a product manager and currently leading a team to develop a new product. Unfortunately, the …
-
69. Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x. 思路: 这道题不难,用binary search 1-x就行,有…
-
162. Find Peak Element
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠…
-
287. Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), pro…