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
max_sub_array_linear
linear O(n) search
53. Maximum Subarray/src/main.rs:27
Method
max_value
(n: i32, index: i32, max_sum: i32)
1802. Number of Students Unable to Eat Lunch/src/lib.rs:4
Method
maximalRectangle
dp orz
85. Maximal Rectangle/Solution.cpp:15
Method
maximum_beauty
(mut nums: Vec<i32>, k: i32)
704. 二分查找/src/main.rs:723
Function
maximum_element_after_decrementing_and_rearranging
(mut arr: Vec<i32>)
1669. Minimum Cost to Cut a Stick/src/main.rs:523
Method
maximum_jumps
(nums: Vec<i32>, target: i32)
cn/739. 每日温度/src/main.rs:177
Method
maximum_wealth
(accounts: Vec<Vec<i32>>)
cn/1672. 最富有客户的资产总量/src/main.rs:8
Method
median_sliding_window
(nums: Vec<i32>, k: i32)
Two Heaps/480. Sliding Window Median/src/main.rs:11
Method
merge
(mut intervals: Vec<Vec<i32>>)
Merge Intervals/56. Merge Intervals/src/main.rs:11
Method
merge
(nums1: &mut Vec<i32>, m: i32, nums2: &mut Vec<i32>, n: i32)
88. Merge Sorted Array/src/main.rs:7
Method
merge
merge two vectors to get the max number, use vector comparsion O(n) time
Dynamic Programming/321. Create Maximum Number/src/main.rs:25
Method
mergeSort
493. Reverse Pairs/Solution.cpp:18
Method
merge_in_between
( mut list1: Option<Box<ListNode>>, a: i32, b: i32, list2: Option<Box<ListNode
1669. Minimum Cost to Cut a Stick/src/main.rs:478
Method
merge_k_lists
this is not written by myself XD, refresh
23. Merge k Sorted Lists/src/main.rs:89
Method
merge_k_lists
(lists: Vec<Option<Box<ListNode>>>)
23. Merge k Sorted Lists/src/main_bruteforce.rs:77
Function
merge_k_lists1
(mut lists: Vec<Option<Box<ListNode>>>)
1669. Minimum Cost to Cut a Stick/src/main.rs:436
Method
merge_two_lists
( l1: Option<Box<ListNode>>, l2: Option<Box<ListNode>>)
21. Merge Two Sorted Lists/src/main.rs:48
Method
minCost
this is a graph dfs problem to search the min distance */
Weekly Contest 178/1368. Minimum Cost to Make at Least One Valid Path in a Grid/Solution.cpp:13
Method
minPathSum
64. Minimum Path Sum/Solution.cpp:16
Method
min_depth
bfs, use queue
Tree/111. Minimum Depth of Binary Tree/src/main.rs:32
Method
min_distance
2d dp -> reduce to O(n) space Time: O(mn) not clear and beautiful as before
72. Edit Distance/src/main.rs:11
Method
min_falling_path_sum
(mut matrix: Vec<Vec<i32>>)
931. Maximum Frequency Stack/src/lib.rs:4
Method
min_falling_path_sum
(mut matrix: Vec<Vec<i32>>)
1289. Day of the Week/src/lib.rs:4
Method
min_k_bit_flips
do you know what "code is comment itself" means ?
995. Minimum Number of K Consecutive Bit Flips/src/main.rs:10
Method
min_moves_to_seat
(mut seats: Vec<i32>, mut students: Vec<i32>)
2037. Count Square Sum Triples/src/lib.rs:4
Method
min_operations
(nums: Vec<i32>, x: i32)
1658. Minimum Swaps to Arrange a Binary Grid/src/lib.rs:4
Method
min_path_sum
(mut grid: Vec<Vec<i32>>)
64. Minimum Path Sum/src/main.rs:12
Function
min_side_jumps
(obstacles: Vec<i32>)
1824. Maximum Number of Eaten Apples/src/lib.rs:1
Method
min_sub_array_len
(target: i32, nums: Vec<i32>)
704. 二分查找/src/main.rs:878
Method
min_sub_array_len2
(target: i32, nums: Vec<i32>)
704. 二分查找/src/main.rs:896
Method
min_subsequence
(mut nums: Vec<i32>)
Weekly Contest 183/p1/src/main.rs:8
Method
min_window
(s: String, t: String)
Sliding Window/76. Minimum Window Substring/src/main.rs:8
Method
minimum_index
在构建freq的同时记录当前的支配元素?需要orderedmap 用一个变量来记录就行了吧?
704. 二分查找/src/main.rs:777
Method
minimum_length
(s: String)
1750. Check If Two Expression Trees are Equivalent/src/main.rs:8
Method
minimum_moves
(s: String)
2027. Maximum Number of Removable Characters/src/main.rs:28
Method
minimum_total
(mut triangle: Vec<Vec<i32>>)
120. Triangle/src/main.rs:8
Method
missing_number
(mut nums: Vec<i32>)
Cyclic Sort/268. Missing Number/src/main.rs:8
Method
most_common_word
(paragraph: String, banned: Vec<String>)
cn/819. 最常见的单词/src/main.rs:10
Method
moves_to_chessboard
(board: Vec<Vec<i32>>)
782. Transform to Chessboard/src/main.rs:124
Method
multiply
(num1: String, num2: String)
43. Multiply Strings/src/main.rs:8
Method
mutate
(x: char)
704. 二分查找/src/main.rs:60
Method
my_atoi
(input: String)
8. String to Integer (atoi)/src/main.rs:11
Method
my_pow
do the same thing as powi(n): pub fn powi(self, n: i32) -> f64
50. Pow(x, n)/src/main.rs:9
Method
my_sqrt
(x: i32)
69. Sqrt(x)/src/main.rs:8
Function
my_test
()
1802. Number of Students Unable to Eat Lunch/src/lib.rs:42
Method
n_unique_char
(s: &[char], k: i32, n: usize)
Sliding Window/395. Longest Substring with At Least K Repeating Characters/src/main.rs:17
Function
name
()
25. Reverse Nodes in k-Group/src/main.rs:162
Method
new
(expect: i32, count: i32)
30. Substring with Concatenation of All Words/src/main.rs:163
Method
new
(val: i32)
82. Remove Duplicates from Sorted List II/src/main.rs:28
Method
new
(val: i32)
2. Add Two Numbers/src/main.rs:10
Method
new
()
704. 二分查找/src/main.rs:78
Method
new
(val: i32)
92. Reverse Linked List II/src/main.rs:28
Method
new
(l: i32, r: i32)
855. Count Unique Characters of All Substrings of a Given String/src/lib.rs:10
Method
new
(n: i32)
855. Count Unique Characters of All Substrings of a Given String/src/lib_bkup_ac.rs:11
Method
new
(n: i32)
855. Count Unique Characters of All Substrings of a Given String/src/lib_bkup.rs:14
Method
new
(n: usize)
1632. Number of Good Ways to Split a String/src/lib.rs:7
Method
new
(val: i32)
23. Merge k Sorted Lists/src/main.rs:60
Method
new
(val: i32)
23. Merge k Sorted Lists/src/main_bruteforce.rs:66
Method
new
(val: i32)
61. Rotate List/src/main.rs:21
Method
new
(p: char, idx: usize)
32. Longest Valid Parentheses/src/main.rs:82
Method
new
(val: i32)
Two Pointers/234. Palindrome Linked List/src/main.rs:23
Method
new
(val: i32)
24. Swap Nodes in Pairs/src/main.rs:28
Method
new
(m: i32, k: i32)
1825. Find Minimum Time to Finish All Jobs/src/lib.rs:61
Method
new
(val: i32)
21. Merge Two Sorted Lists/src/main.rs:37
Method
new
(val: i32)
Tree/113. Path Sum II/src/main.rs:17
Method
new
(val: i32, left: Option<Rc<RefCell<TreeNode>>>, right: Option<Rc<RefCell<TreeNode>>>)
Tree/938. Range Sum of BST/src/main.rs:20
Method
new
(val: i32)
Tree/103. Binary Tree Zigzag Level Order Traversal/src/main.rs:17
Method
new
(val: i32)
Tree/111. Minimum Depth of Binary Tree/src/main.rs:17
Method
new
(m: usize, n: usize)
Weekly Contest 181/1391. Check if There is a Valid Path in a Grid/src/main.rs:39
Method
new
initialize your data structure here. */
155. Min Stack/src/main.rs:17
Method
new
(s: &'a [char], p: &'a [char], dp: &'a mut Vec<Vec<i32>>)
44. Wildcard Matching/src/main.rs:116
Method
new
what kind of macro is this?
19. Remove Nth Node From End of List/src/main.rs:41
Method
new
(val: i32)
86. Partition List/src/main.rs:32
Method
new
(val: i32)
337. House Robber III/src/main.rs:17
Method
new
(mut stack: Vec<i32>)
Dynamic Programming/321. Create Maximum Number/src/main.rs:75
Method
new
(val: i32)
1669. Minimum Cost to Cut a Stick/src/main.rs:73
Method
new
()
1669. Minimum Cost to Cut a Stick/src/list.rs:17
Method
new
()
Two Heaps/480. Sliding Window Median/src/main.rs:36
Method
new
initialize your data structure here. */
Two Heaps/295. Find Median from Data Stream/src/main.rs:25
Method
new
(val: i32)
cn/1305. 两棵二叉搜索树中的所有元素/src/main.rs:27
Method
new
(iter: A)
1759. Find the Missing IDs/src/main.rs:69
Method
new
(pizza: &Vec<String>)
1444. Number of Steps to Reduce a Number to Zero/src/main.rs:32
Method
new
(val: i32)
25. Reverse Nodes in k-Group/src/main.rs:26
Method
next
Two Pointers/202. Happy Number/Solution.cpp:17
Method
next
(&mut self)
1669. Minimum Cost to Cut a Stick/src/list.rs:75
Method
nextPermutation
31. Next Permutation/Solution.cpp:15
Method
next_greater_element
(nums1: Vec<i32>, nums2: Vec<i32>)
cn/739. 每日温度/src/main.rs:255
Method
next_greater_elements
(nums: Vec<i32>)
cn/739. 每日温度/src/main.rs:239
Method
next_idx
(i: usize, num: i32, len: usize)
Two Pointers/457. Circular Array Loop/src/main.rs:44
Method
next_permutation
(nums: &mut Vec<i32>)
47. Permutations II/src/main.rs:21
Method
next_permutation
(nums: &mut Vec<i32>)
31. Next Permutation/src/main.rs:8
Method
next_permutation
679. 24 Game/Solution.cpp:66
Method
node2vec
(head: &Option<Box<ListNode>>)
23. Merge k Sorted Lists/src/main_bruteforce.rs:83
Function
none
()
25. Reverse Nodes in k-Group/src/main.rs:154
Function
null
()
10. Regular Expression Matching/src/main.rs:61
Method
numIslands
200. Number of Islands/Solution.cpp:34
Method
numOfMinutes
Weekly Contest 179/p3/Solution.cpp:25
Method
numTeams
Weekly Contest 182/1395. Count Number of Teams/Solution.cpp:15
Method
numTrees
my version for each round i `buf[x]` means **the number of trees** that has `x` right nodes base on the `buf` vector of the `i - 1` round, we can calc
96. Unique Binary Search Trees/Solution.cpp:20
Method
numTrees_dp
dp thought O(n) time O(n) space
96. Unique Binary Search Trees/Solution.cpp:43
← previous
next →
901–1,000 of 1,163, ranked by callers