Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Ainevsia/Leetcode-Rust
/ functions
Functions
1,163 in github.com/Ainevsia/Leetcode-Rust
⨍
Functions
1,163
◇
Types & classes
350
Method
num_decodings
(s: String)
91. Decode Ways/src/main.rs:8
Method
num_decodings
(s: String)
639. Decode Ways II/src/main.rs:8
Method
num_islands
(mut grid: Vec<Vec<char>>)
200. Number of Islands/src/main.rs:8
Method
num_steps
(s: String)
Weekly Contest 183/p2/src/main.rs:8
Method
num_subarray_product_less_than_k
sliding window nums.len() > 0
Two Pointers/713. Subarray Product Less Than K/src/main.rs:11
Function
odd
()
33. Search in Rotated Sorted Array/src/main.rs:83
Function
odd_not_found
()
33. Search in Rotated Sorted Array/src/main.rs:108
Method
oper
679. 24 Game/Solution.cpp:51
Function
operator++
679. 24 Game/Solution.cpp:17
Method
part
(s: & Vec<char>, end: usize)
131. Palindrome Partitioning/src/main.rs:16
Method
partial_cmp
(&self, other: &ListNode)
23. Merge k Sorted Lists/src/main.rs:76
Method
partial_cmp
(&self,o:&Z)
1669. Minimum Cost to Cut a Stick/src/main.rs:217
Method
partition
(s: String)
131. Palindrome Partitioning/src/main.rs:11
Method
path_sum
(root: Option<Rc<RefCell<TreeNode>>>, sum: i32)
Tree/113. Path Sum II/src/main.rs:30
Method
paths_with_max_score
(board: Vec<String>)
1301. Reformat Department Table/src/lib.rs:6
Method
pb
(board: &Vec<Vec<char>>)
37. Sudoku Solver/src/main.rs:61
Function
peek
()
1669. Minimum Cost to Cut a Stick/src/list.rs:144
Method
peek
(&mut self)
704. 二分查找/src/main.rs:158
Method
peek_first
(&mut self)
1759. Find the Missing IDs/src/main.rs:39
Method
permute
(nums: Vec<i32>)
46. Permutations/src/main.rs:8
Method
permute_add
(permutation: &mut Vec<Vec<i32>>, elem: i32)
46. Permutations/src/main.rs:17
Function
permute_add_basic
()
46. Permutations/src/main.rs:53
Method
permute_once
(old: &Vec<String>, new: &mut Vec<String>, list: &Vec<&str>)
17. Letter Combinations of a Phone Number/src/main.rs:29
Method
permute_unique
(mut nums: Vec<i32>)
47. Permutations II/src/main.rs:8
Method
plus_one
(mut digits: Vec<i32>)
66. Plus One/src/main.rs:8
Method
pop_line
(martrix: &mut Vec<Vec<i32>>, res: &mut Vec<i32>)
54. Spiral Matrix/src/main.rs:30
Method
product_except_self
use the output vector to achieve O(n) space
238. Product of Array Except Self/src/main.rs:9
Method
projectionArea
O(n) extra space can optimize? can be optimized to O(1) space but iterate through the grid more than once
883. Projection Area of 3D Shapes/Solution.cpp:17
Method
prune_tree
(root: Option<Rc<RefCell<TreeNode>>>)
1669. Minimum Cost to Cut a Stick/src/main.rs:98
Method
quickSelect
l and r are both inclusive
215. Kth Largest Element in an Array/Solution.cpp:16
Method
range_sum_bst
(root: Option<Rc<RefCell<TreeNode>>>, l: i32, r: i32)
Tree/938. Range Sum of BST/src/main.rs:28
Method
rankTeams
Weekly Contest 178/1366. Rank Teams by Votes/Solution.cpp:12
Method
rearrange_characters
(s: String, target: String)
2287. Minimum Number of Lines to Cover Points/src/lib.rs:4
Method
recoverTree
99. Recover Binary Search Tree/Solution.cpp:46
Method
remove_duplicate_letters
(s: String)
316. Remove Duplicate Letters/src/main.rs:14
Method
remove_duplicates
(s: String)
704. 二分查找/src/main.rs:31
Method
remove_duplicates
(nums: &mut Vec<i32>)
26. Remove Duplicates from Sorted Array/src/main.rs:8
Method
remove_duplicates
(nums: &mut Vec<i32>)
80. Remove Duplicates from Sorted Array II/src/main.rs:10
Method
remove_duplicates_twopointer
(nums: &mut Vec<i32>)
80. Remove Duplicates from Sorted Array II/src/main.rs:22
Method
remove_element
(nums: &mut Vec<i32>, val: i32)
704. 二分查找/src/main.rs:992
Method
remove_element
(nums: &mut Vec<i32>, val: i32)
27. Remove Element/src/main.rs:8
Method
remove_element2
(nums: &mut Vec<i32>, val: i32)
704. 二分查找/src/main.rs:1006
Method
remove_elements
(head: Option<Box<ListNode>>, val: i32)
704. 二分查找/src/main.rs:687
Method
remove_elements2
(head: Option<Box<ListNode>>, val: i32)
704. 二分查找/src/main.rs:703
Method
remove_nth_from_end
(head: Option<Box<ListNode>>, n: i32)
704. 二分查找/src/main.rs:531
Method
remove_nth_from_end
(mut head: Option<Box<ListNode>>, n: i32)
19. Remove Nth Node From End of List/src/main.rs:50
Method
remove_nth_from_end
(mut head: Option<Box<ListNode>>, n: i32)
1669. Minimum Cost to Cut a Stick/src/main.rs:537
Method
remove_nth_from_end1
(mut head: Option<Box<ListNode>>, n: i32)
1669. Minimum Cost to Cut a Stick/src/main.rs:548
Method
remove_palindrome_sub
(s: String)
Weekly Contest 173/5319. Remove Palindromic Subsequences/src/main.rs:20
Method
remove_zero_sum_sublists
(mut head: Option<Box<ListNode>>)
1669. Minimum Cost to Cut a Stick/src/main.rs:220
Method
remove_zero_sum_sublists1
(mut head: Option<Box<ListNode>>)
1669. Minimum Cost to Cut a Stick/src/main.rs:245
Method
repeated_character
(s: String)
2351. Number of Ways to Buy Pens and Pencils/src/lib.rs:4
Method
repeated_substring_pattern
(s: String)
704. 二分查找/src/main.rs:178
Method
replace_space
(s: String)
704. 二分查找/src/main.rs:290
Method
reverse
(x: i32)
7. Reverse Integer/src/main.rs:12
Method
reverse2
(s: &mut [char])
704. 二分查找/src/main.rs:245
Method
reverse_between
(head: Option<Box<ListNode>>, m: i32, n: i32)
92. Reverse Linked List II/src/main.rs:33
Method
reverse_k_group
(mut head: Option<Box<ListNode>>, k: i32)
1669. Minimum Cost to Cut a Stick/src/main.rs:320
Method
reverse_k_group
0 < k <= len, list is not empty
25. Reverse Nodes in k-Group/src/main.rs:38
Method
reverse_left_words
(s: String, n: i32)
704. 二分查找/src/main.rs:237
Method
reverse_list
(mut head: Option<Box<ListNode>>)
704. 二分查找/src/main.rs:571
Method
reverse_once
(mut head: Option<Box<ListNode>>, k: i32)
1669. Minimum Cost to Cut a Stick/src/main.rs:336
Method
reverse_str
(s: String, k: i32)
704. 二分查找/src/main.rs:314
Method
reverse_string
(s: &mut Vec<char>)
704. 二分查找/src/main.rs:331
Method
reverse_words
O(n) space O(n) time
704. 二分查找/src/main.rs:257
Method
rob
1 dp * 2 times equals to this question: the final result will only be one of the two following situations: - first is not selected, then freely select
213. House Robber II/src/main.rs:13
Method
rob
awsome solution : 0 ms
337. House Robber III/src/main.rs:32
Method
rob
1 dp
198. House Robber/src/main.rs:10
Method
robb
return value (not robbed , robbed)
337. House Robber III/src/main.rs:38
Method
roman_to_int
(s: String)
13. Roman to Integer/src/main.rs:9
Method
rotate
(matrix: &mut Vec<Vec<i32>>)
48. Rotate Image/src/main.rs:21
Method
rotate_right
(mut head: Option<Box<ListNode>>, k: i32)
61. Rotate List/src/main.rs:32
Method
s
(nums: & Vec<i32>, target: i32, start: usize, end: usize)
81. Search in Rotated Sorted Array II/src/main.rs:13
Method
search
(nums: Vec<i32>, target: i32)
704. 二分查找/src/main.rs:1025
Method
search
(nums: Vec<i32>, target: i32)
33. Search in Rotated Sorted Array/src/main.rs:9
Method
search
edge case n.size() == 0 buffer overflow : not exist case !!! two element !
81. Search in Rotated Sorted Array II/Solution.cpp:9
Method
search
I just wonder why i use recursive ? two complex
81. Search in Rotated Sorted Array II/src/main.rs:9
Method
search
(board: & Vec<Vec<char>>, word: &[char], i: usize, j: usize, used: &mut Vec<Vec<bool>>)
79. Word Search/src/main.rs:24
Method
search1
(nums: Vec<i32>, target: i32)
704. 二分查找/src/main.rs:1043
Method
search2
(nums: Vec<i32>, target: i32)
704. 二分查找/src/main.rs:1061
Method
searchMatrix
240. Search a 2D Matrix II/Solution.cpp:15
Method
search_insert
(nums: Vec<i32>, target: i32)
35. Search Insert Position/src/main.rs:8
Method
search_matrix
(matrix: Vec<Vec<i32>>, target: i32)
74. Search a 2D Matrix/src/main.rs:8
Method
search_range
(nums: Vec<i32>, target: i32)
34. Find First and Last Position of Element in Sorted Array/src/main.rs:8
Method
setZeroes
constant space
73. Set Matrix Zeroes/Solution.cpp:55
Method
setZeroes1
straight forward version
73. Set Matrix Zeroes/Solution.cpp:11
Method
setZeroes2
straight forward version
73. Set Matrix Zeroes/Solution.cpp:32
Method
shift_left
(s: String, shift: usize)
30-Day LeetCoding Challenge/Perform String Shifts/src/main.rs:28
Method
shortest_to_char
(s: String, c: char)
cn/821. 字符的最短距离/src/main.rs:10
Method
single_number
You should remember two things from this: x xor x = 0 0 xor x = x. Now you have two more xor properties you can use to solve problems. Good Luck!
136. Single Number/src/main.rs:12
Function
small
()
33. Search in Rotated Sorted Array/src/main.rs:52
Method
smallerNumbersThanCurrent
Weekly Contest 178/1365. How Many Numbers Are Smaller Than the Current Number/Solution.cpp:10
Method
solve
(board: &mut Vec<Vec<char>>, line: usize, ret: &mut Vec<Vec<String>>)
51. N-Queens/src/main.rs:17
Method
solve
(board: &mut Vec<Vec<char>>)
37. Sudoku Solver/src/main.rs:29
Method
solve
(board: &mut Vec<Vec<char>>, line: usize, ret: &mut i32)
52. N-Queens II/src/main.rs:16
Method
solve_n_queens
(n: i32)
51. N-Queens/src/main.rs:8
Method
solve_sudoku
(board: &mut Vec<Vec<char>>)
37. Sudoku Solver/src/main.rs:25
Method
sort_colors
[one..=two] (both inclusive) are unordered three pointers
Two Pointers/75. Sort Colors/src/main.rs:11
Method
sort_list
(mut head: Option<Box<ListNode>>)
1669. Minimum Cost to Cut a Stick/src/main.rs:287
Method
sortedListToBST
two pointers
109. Convert Sorted List to Binary Search Tree/Solution.cpp:30
← previous
next →
1,001–1,100 of 1,163, ranked by callers