JavaImplementation Algorithm
1.0.0
The question comes from leet-code China . It records some implementation questions that I use Java mainly have medium difficulty and simple difficulty, and continue to update
| topic | accomplish | Solutions |
|---|---|---|
| 338. Bit Count | O(n) time complexity implementation | |
| 222. Number of nodes in a completely binary tree | Recursive implementation | |
| 287. Looking for repetitions | O(n) time complexity implementation | |
| 134. Gas station | O(n) time complexity implementation | |
| 367. Valid complete square number | O(log(n)) time complexity implementation | Using binary search, you need to pay attention to the problem that multiplication of int values may overflow |
| 477. The total distance of Hanming | O(n) time complexity implementation | |
| 142. Ring List II | Two traversal implementation | |
| 48. Rotate the image | O(n^2) implementation | |
| 189. Rotate the array | O(n) time complexity implementation | |
| 718. Longest repeat subarray | O(n * m) time complexity implementation | |
| 209. The smallest subarray | Worst-case time complexity bit O(n^2) | |
| 54. Helical Matrix | When the length or height of the rectangle converges to 1, you need to pay attention to the problem of repeated printing. | |
| 135. Distribute candy | Record the minimum amount of candy required at each position from the beginning | Greedy Algorithm |