An open API service indexing awesome lists of open source software.

https://github.com/liby/leetcode

Rust Solution
https://github.com/liby/leetcode

Last synced: over 1 year ago
JSON representation

Rust Solution

Awesome Lists containing this project

README

          

# Rust Solution

1. [Two Sum](https://github.com/liby/leetcode/blob/main/solutions/1.two-sum.rs)
2. [Reverse Integer](https://github.com/liby/leetcode/blob/main/solutions/7.reverse-integer.rs)
3. [Palindrome Number](https://github.com/liby/leetcode/blob/main/solutions/9.palindrome-number.rs)
4. [Roman to Integer](https://github.com/liby/leetcode/blob/main/solutions/13.roman-to-integer.rs)
5. [Longest Common Prefix](https://github.com/liby/leetcode/blob/main/solutions/14.longest-common-prefix.rs)
6. [Valid Parentheses](https://github.com/liby/leetcode/blob/main/solutions/20.valid-parentheses.rs)
7. [Merge Two Sorted Lists](https://github.com/liby/leetcode/blob/main/solutions/21.merge-two-sorted-lists.rs)
8. [Remove Duplicates from Sorted Array](https://github.com/liby/leetcode/blob/main/solutions/26.remove-duplicates-from-sorted-array.rs)
9. [Remove Element](https://github.com/liby/leetcode/blob/main/solutions/27.remove-element.rs)
10. [Implement strStr()](https://github.com/liby/leetcode/blob/main/solutions/28.implement-str-str.rs)
11. [Search Insert Position](https://github.com/liby/leetcode/blob/main/solutions/35.search-insert-position.rs)
12. [Maximum Subarray](https://github.com/liby/leetcode/blob/main/solutions/53.maximum-subarray.rs)
13. [Length of Last Word](https://github.com/liby/leetcode/blob/main/solutions/58.length-of-last-word.rs)
14. [Plus One](https://github.com/liby/leetcode/blob/main/solutions/66.plus-one.rs)
15. [Add Binary](https://github.com/liby/leetcode/blob/main/solutions/67.add-binary.rs)
16. [Sqrt(x)](https://github.com/liby/leetcode/blob/main/solutions/69.sqrt-x.rs)
17. [Climbing Stairs](https://github.com/liby/leetcode/blob/main/solutions/70.climbing-stairs.rs)
18. [Remove Duplicates from Sorted List](https://github.com/liby/leetcode/blob/main/solutions/83.remove-duplicates-from-sorted-list.rs)
19. [Merge Sorted Array](https://github.com/liby/leetcode/blob/main/solutions/88.merge-sorted-array.rs)
20. [Binary Tree Inorder Traversal](https://github.com/liby/leetcode/blob/main/solutions/94.binary-tree-inorder-traversal.rs)
21. [Same Tree](https://github.com/liby/leetcode/blob/main/solutions/100.same-tree.rs)
22. [Symmetric Tree](https://github.com/liby/leetcode/blob/main/solutions/101.symmetric-tree.rs)
23. [Maximum Depth of Binary Tree](https://github.com/liby/leetcode/blob/main/solutions/104.maximum-depth-of-binary-tree.rs)
24. [Best Time to Buy and Sell Stock](https://github.com/liby/leetcode/blob/main/solutions/121.best-time-to-buy-and-sell-stock.rs)
25. [Valid Palindrome](https://github.com/liby/leetcode/blob/main/solutions/125.valid-palindrome.rs)
26. [Two Sum II - Input array is sorted](https://github.com/liby/leetcode/blob/main/solutions/167.two-sum-ii-input-array-is-sorted.rs)
27. [Excel Sheet Column Title](https://github.com/liby/leetcode/blob/main/solutions/168.excel-sheet-column-title.rs)
28. [Majority Element](https://github.com/liby/leetcode/blob/main/solutions/169.majority-element.rs)
29. [Excel Sheet Column Number](https://github.com/liby/leetcode/blob/main/solutions/171.excel-sheet-column-number.rs)
30. [Factorial Trailing Zeroes](https://github.com/liby/leetcode/blob/main/solutions/172.factorial-trailing-zeroes.rs)
31. [Reverse Bits](https://github.com/liby/leetcode/blob/main/solutions/190.reverse-bits.rs)
32. [Number of 1 Bits](https://github.com/liby/leetcode/blob/main/solutions/191.number-of-1-bits.rs)
33. [Happy Number](https://github.com/liby/leetcode/blob/main/solutions/202.happy-number.rs)
34. [Count Primes](https://github.com/liby/leetcode/blob/main/solutions/204.count-primes.rs)
35. [Contains Duplicate](https://github.com/liby/leetcode/blob/main/solutions/217.contains-duplicate.rs)
36. [Contains Duplicate II](https://github.com/liby/leetcode/blob/main/solutions/219.contains-duplicate-ii.rs)
37. [Summary Ranges](https://github.com/liby/leetcode/blob/main/solutions/228.summary-ranges.rs)
38. [Power of Two](https://github.com/liby/leetcode/blob/main/solutions/231.power-of-two.rs)
39. [Valid Anagram](https://github.com/liby/leetcode/blob/main/solutions/242.valid-anagram.rs)
40. [Add Digits](https://github.com/liby/leetcode/blob/main/solutions/258.add-digits.rs)
41. [Ugly Number](https://github.com/liby/leetcode/blob/main/solutions/263.ugly-number.rs)
42. [Missing Number](https://github.com/liby/leetcode/blob/main/solutions/268.missing-number.rs)
43. [First Bad Version](https://github.com/liby/leetcode/blob/main/solutions/278.first-bad-version.rs)
44. [Move Zeroes](https://github.com/liby/leetcode/blob/main/solutions/283.move-zeroes.rs)
45. [Nim Game](https://github.com/liby/leetcode/blob/main/solutions/292.nim-game.rs)
46. [Range Sum Query - Immutable](https://github.com/liby/leetcode/blob/main/solutions/303.range-sum-query-immutable.rs)
47. [Power of Three](https://github.com/liby/leetcode/blob/main/solutions/326.power-of-three.rs)
48. [Counting Bits](https://github.com/liby/leetcode/blob/main/solutions/338.counting-bits.rs)
49. [Power of Four](https://github.com/liby/leetcode/blob/main/solutions/342.power-of-four.rs)
50. [Reverse String](https://github.com/liby/leetcode/blob/main/solutions/344.reverse-string.rs)
51. [Reverse Vowels of a String](https://github.com/liby/leetcode/blob/main/solutions/345.reverse-vowels-of-a-string.rs)
52. [Intersection of Two Arrays](https://github.com/liby/leetcode/blob/main/solutions/349.intersection-of-two-arrays.rs)
53. [Valid Perfect Square](https://github.com/liby/leetcode/blob/main/solutions/367.valid-perfect-square.rs)
54. [Guess Number Higher or Lower](https://github.com/liby/leetcode/blob/main/solutions/374.guess-number-higher-or-lower.rs)
55. [Ransom Note](https://github.com/liby/leetcode/blob/main/solutions/383.ransom-note.rs)
56. [First Unique Character in a String](https://github.com/liby/leetcode/blob/main/solutions/387.first-unique-character-in-a-string.rs)
57. [Find the Difference](https://github.com/liby/leetcode/blob/main/solutions/389.find-the-difference.rs)
58. [Is Subsequence](https://github.com/liby/leetcode/blob/main/solutions/392.is-subsequence.rs)
59. [Binary Watch](https://github.com/liby/leetcode/blob/main/solutions/401.binary-watch.rs)
60. [Sum of Left Leaves](https://github.com/liby/leetcode/blob/main/solutions/404.sum-of-left-leaves.rs)
61. [Convert a Number to Hexadecimal](https://github.com/liby/leetcode/blob/main/solutions/405.convert-a-number-to-hexadecimal.rs)
62. [Longest Palindrome](https://github.com/liby/leetcode/blob/main/solutions/409.longest-palindrome.rs)
63. [Fizz Buzz](https://github.com/liby/leetcode/blob/main/solutions/412.fizz-buzz.rs)
64. [Third Maximum Number](https://github.com/liby/leetcode/blob/main/solutions/414.third-maximum-number.rs)
65. [Add Strings](https://github.com/liby/leetcode/blob/main/solutions/415.add-strings.rs)
66. [Number of Segments in a String](https://github.com/liby/leetcode/blob/main/solutions/434.number-of-segments-in-a-string.rs)
67. [Arranging Coins](https://github.com/liby/leetcode/blob/main/solutions/441.arranging-coins.rs)
68. [Find All Numbers Disappeared in an Array](https://github.com/liby/leetcode/blob/main/solutions/448.find-all-numbers-disappeared-in-an-array.rs)
69. [Assign Cookies](https://github.com/liby/leetcode/blob/main/solutions/455.assign-cookies.rs)
70. [Hamming Distance](https://github.com/liby/leetcode/blob/main/solutions/461.hamming-distance.rs)
71. [Island Perimeter](https://github.com/liby/leetcode/blob/main/solutions/463.island-perimeter.rs)
72. [Number Complement](https://github.com/liby/leetcode/blob/main/solutions/476.number-complement.rs)
73. [License Key Formatting](https://github.com/liby/leetcode/blob/main/solutions/482.license-key-formatting.rs)
74. [Max Consecutive Ones](https://github.com/liby/leetcode/blob/main/solutions/485.max-consecutive-ones.rs)
75. [Construct the Rectangle](https://github.com/liby/leetcode/blob/main/solutions/492.construct-the-rectangle.rs)
76. [Teemo Attacking](https://github.com/liby/leetcode/blob/main/solutions/495.teemo-attacking.rs)
77. [Next Greater Element I](https://github.com/liby/leetcode/blob/main/solutions/496.next-greater-element-i.rs)
78. [Keyboard Row](https://github.com/liby/leetcode/blob/main/solutions/500.keyboard-row.rs)
79. [Find Mode in Binary Search Tree](https://github.com/liby/leetcode/blob/main/solutions/501.find-mode-in-binary-search-tree.rs)
80. [Base 7](https://github.com/liby/leetcode/blob/main/solutions/504.base-7.rs)
81. [Perfect Number](https://github.com/liby/leetcode/blob/main/solutions/507.perfect-number.rs)
82. [Most Frequent Subtree Sum](https://github.com/liby/leetcode/blob/main/solutions/508.most-frequent-subtree-sum.rs)
83. [Fibonacci Number](https://github.com/liby/leetcode/blob/main/solutions/509.fibonacci-number.rs)
84. [Detect Capital](https://github.com/liby/leetcode/blob/main/solutions/520.detect-capital.rs)
85. [Longest Uncommon Subsequence I](https://github.com/liby/leetcode/blob/main/solutions/521.longest-uncommon-subsequence-i.rs)
86. [Reverse String II](https://github.com/liby/leetcode/blob/main/solutions/541.reverse-string-ii.rs)
87. [Student Attendance Record I](https://github.com/liby/leetcode/blob/main/solutions/551.student-attendance-record-i.rs)
88. [Reverse Words in a String III](https://github.com/liby/leetcode/blob/main/solutions/557.reverse-words-in-a-string-iii.rs)
89. [Array Partition I](https://github.com/liby/leetcode/blob/main/solutions/561.array-partition-i.rs)
90. [Binary Tree Tilt](https://github.com/liby/leetcode/blob/main/solutions/563.binary-tree-tilt.rs)
91. [Reshape the Matrix](https://github.com/liby/leetcode/blob/main/solutions/566.reshape-the-matrix.rs)
92. [Distribute Candies](https://github.com/liby/leetcode/blob/main/solutions/575.distribute-candies.rs)
93. [Longest Harmonious Subsequence](https://github.com/liby/leetcode/blob/main/solutions/594.longest-harmonious-subsequence.rs)
94. [Range Addition II](https://github.com/liby/leetcode/blob/main/solutions/598.range-addition-ii.rs)
95. [Can Place Flowers](https://github.com/liby/leetcode/blob/main/solutions/605.can-place-flowers.rs)
96. [Merge Two Binary Trees](https://github.com/liby/leetcode/blob/main/solutions/617.merge-two-binary-trees.rs)
97. [Maximum Product of Three Numbers](https://github.com/liby/leetcode/blob/main/solutions/628.maximum-product-of-three-numbers.rs)
98. [Maximum Average Subarray I](https://github.com/liby/leetcode/blob/main/solutions/643.maximum-average-subarray-i.rs)
99. [Two Sum IV - Input is a BST](https://github.com/liby/leetcode/blob/main/solutions/653.two-sum-iv-input-is-a-bst.rs)
100. [Longest Continuous Increasing Subsequence](https://github.com/liby/leetcode/blob/main/solutions/674.longest-continuous-increasing-subsequence.rs)
101. [Valid Palindrome II](https://github.com/liby/leetcode/blob/main/solutions/680.valid-palindrome-ii.rs)
102. [Baseball Game](https://github.com/liby/leetcode/blob/main/solutions/682.baseball-game.rs)
103. [Binary Number with Alternating Bits](https://github.com/liby/leetcode/blob/main/solutions/693.binary-number-with-alternating-bits.rs)
104. [Count Binary Substrings](https://github.com/liby/leetcode/blob/main/solutions/696.count-binary-substrings.rs)
105. [Degree of an Array](https://github.com/liby/leetcode/blob/main/solutions/697.degree-of-an-array.rs)
106. [Search in a Binary Search Tree](https://github.com/liby/leetcode/blob/main/solutions/700.search-in-a-binary-search-tree.rs)
107. [Binary Search](https://github.com/liby/leetcode/blob/main/solutions/704.binary-search.rs)
108. [Design HashSet](https://github.com/liby/leetcode/blob/main/solutions/705.design-hash-set.rs)
109. [Design HashMap](https://github.com/liby/leetcode/blob/main/solutions/706.design-hash-map.rs)
110. [To Lower Case](https://github.com/liby/leetcode/blob/main/solutions/709.to-lower-case.rs)
111. [1-bit and 2-bit Characters](https://github.com/liby/leetcode/blob/main/solutions/717.1-bit-and-2-bit-characters.rs)
112. [Find Pivot Index](https://github.com/liby/leetcode/blob/main/solutions/724.find-pivot-index.rs)
113. [Flood Fill](https://github.com/liby/leetcode/blob/main/solutions/733.flood-fill.rs)
114. [Find Smallest Letter Greater Than Target](https://github.com/liby/leetcode/blob/main/solutions/744.find-smallest-letter-greater-than-target.rs)
115. [Min Cost Climbing Stairs](https://github.com/liby/leetcode/blob/main/solutions/746.min-cost-climbing-stairs.rs)
116. [Largest Number At Least Twice of Others](https://github.com/liby/leetcode/blob/main/solutions/747.largest-number-at-least-twice-of-others.rs)
117. [Shortest Completing Word](https://github.com/liby/leetcode/blob/main/solutions/748.shortest-completing-word.rs)
118. [Prime Number of Set Bits in Binary Representation](https://github.com/liby/leetcode/blob/main/solutions/762.prime-number-of-set-bits-in-binary-representation.rs)
119. [Toeplitz Matrix](https://github.com/liby/leetcode/blob/main/solutions/766.toeplitz-matrix.rs)
120. [Jewels and Stones](https://github.com/liby/leetcode/blob/main/solutions/771.jewels-and-stones.rs)
121. [Rotate String](https://github.com/liby/leetcode/blob/main/solutions/796.rotate-string.rs)
122. [Unique Morse Code Words](https://github.com/liby/leetcode/blob/main/solutions/804.unique-morse-code-words.rs)
123. [Number of Lines To Write String](https://github.com/liby/leetcode/blob/main/solutions/806.number-of-lines-to-write-string.rs)
124. [Most Common Word](https://github.com/liby/leetcode/blob/main/solutions/819.most-common-word.rs)
125. [Shortest Distance to a Character](https://github.com/liby/leetcode/blob/main/solutions/821.shortest-distance-to-a-character.rs)
126. [Goat Latin](https://github.com/liby/leetcode/blob/main/solutions/824.goat-latin.rs)
127. [Positions of Large Groups](https://github.com/liby/leetcode/blob/main/solutions/830.positions-of-large-groups.rs)
128. [Flipping an Image](https://github.com/liby/leetcode/blob/main/solutions/832.flipping-an-image.rs)
129. [Rectangle Overlap](https://github.com/liby/leetcode/blob/main/solutions/836.rectangle-overlap.rs)
130. [Peak Index in a Mountain Array](https://github.com/liby/leetcode/blob/main/solutions/852.peak-index-in-a-mountain-array.rs)
131. [Buddy Strings](https://github.com/liby/leetcode/blob/main/solutions/859.buddy-strings.rs)
132. [Lemonade Change](https://github.com/liby/leetcode/blob/main/solutions/860.lemonade-change.rs)
133. [Binary Gap](https://github.com/liby/leetcode/blob/main/solutions/868.binary-gap.rs)
134. [Leaf-Similar Trees](https://github.com/liby/leetcode/blob/main/solutions/872.leaf-similar-trees.rs)
135. [Middle of the Linked List](https://github.com/liby/leetcode/blob/main/solutions/876.middle-of-the-linked-list.rs)
136. [Projection Area of 3D Shapes](https://github.com/liby/leetcode/blob/main/solutions/883.projection-area-of-3-d-shapes.rs)
137. [Uncommon Words from Two Sentences](https://github.com/liby/leetcode/blob/main/solutions/884.uncommon-words-from-two-sentences.rs)
138. [Fair Candy Swap](https://github.com/liby/leetcode/blob/main/solutions/888.fair-candy-swap.rs)
139. [Surface Area of 3D Shapes](https://github.com/liby/leetcode/blob/main/solutions/892.surface-area-of-3-d-shapes.rs)
140. [Monotonic Array](https://github.com/liby/leetcode/blob/main/solutions/896.monotonic-array.rs)

## Thanks

Special thanks to [JetBrains](https://jb.gg/OpenSourceSupport) for providing the license certificate to the project.