MCPcopy Create free account

hub / github.com/Ainevsia/Leetcode-Rust / functions

Functions1,163 in github.com/Ainevsia/Leetcode-Rust

Methodsorted_squares
(mut nums: Vec<i32>)
704. 二分查找/src/main.rs:929
Methodsorted_squares
two pointers
Two Pointers/977. Squares of a Sorted Array/src/main.rs:9
Methodsorted_squares2
(mut nums: Vec<i32>)
704. 二分查找/src/main.rs:949
Methodspiral_order
(mut matrix: Vec<Vec<i32>>)
54. Spiral Matrix/src/main.rs:14
Methodsquare_sum
(mut n: i32)
Two Pointers/202. Happy Number/src/main.rs:23
MethodstrStr
28. Implement strStr()/Solution.cpp:34
Methodstr_is_number
(s: &str)
65. Valid Number/src/main.rs:25
Methodstr_str
(haystack: String, needle: String)
704. 二分查找/src/main.rs:201
Methodstr_str
(haystack: String, needle: String)
28. Implement strStr()/src/main.rs:17
Methodstring_shift
(s: String, shift: Vec<Vec<i32>>)
30-Day LeetCoding Challenge/Perform String Shifts/src/main.rs:12
Functionstrong_password_checker_ii
(password: String)
2299. Merge Nodes in Between Zeros/src/lib.rs:1
Methodsubarrays_with_k_distinct
(a: Vec<i32>, k: i32)
Sliding Window/992. Subarrays with K Different Integers/src/main.rs:8
Methodsubsets
bit mask
78. Subsets/Solution.cpp:11
Methodsubsets
Recursion
78. Subsets/src/main.rs:9
MethodsubsetsWithDup
90. Subsets II/Solution.cpp:10
Methodsubsets_with_dup
(mut nums: Vec<i32>)
90. Subsets II/src/main.rs:20
Methodsum
(root: &Option<Rc<RefCell<TreeNode>>>, l: i32, r: i32, sum: &mut i32)
Tree/938. Range Sum of BST/src/main.rs:34
Methodsum
( candidates: &[i32], target: i32, buf: &mut Vec<i32>, target_
40. Combination Sum II/src/main.rs:18
Methodsum_of_squares
(nums: Vec<i32>)
704. 二分查找/src/main.rs:829
MethodsuperEggDrop
Dynamic Programming/887. Super Egg Drop/Solution.cpp:16
Methodsuper_egg_drop
https://leetcode.com/problems/super-egg-drop/discuss/158974/C%2B%2BJavaPython-2D-and-1D-DP-O(KlogN) Original DP definition: I stand on nth floor and g
Dynamic Programming/887. Super Egg Drop/src/main.rs:27
Methodswap_pairs
(mut head: Option<Box<ListNode>>)
704. 二分查找/src/main.rs:550
Methodswap_pairs
(mut head: Option<Box<ListNode>>)
24. Swap Nodes in Pairs/src/main.rs:39
Methodtest
(s_: &str, l: usize)
1044. Longest Duplicate Substring/src/main.rs:35
Functiontest_trie
()
1803. Average Waiting Time/src/lib.rs:89
MethodthreeSum
just like 3 sum
15. 3Sum/Solution.cpp:15
Methodthree_equal_parts
intuition: there must be same number of 1 in each part so there is only one possible solution, no need to simulate use math to simplify the problem Ta
927. Three Equal Parts/src/main.rs:16
Methodthree_sum
find three elements in a sorted array O(n^2) fix the first element and find the remaining two elements in the right subvector
15. 3Sum/src/main.rs:11
Methodthree_sum
implement the default O(n^2) three sum nums must be at least 3 element long
18. 4Sum/src/main.rs:23
Methodthree_sum_closest
(nums: Vec<i32>, target: i32)
16. 3Sum Closest/src/main.rs:8
Functionthree_sum_test
()
18. 4Sum/src/main.rs:76
Functiontle
()
50. Pow(x, n)/src/main.rs:41
Methodto_goat_latin
(sentence: String)
cn/824. 山羊拉丁文/src/main.rs:8
Methodto_str
679. 24 Game/Solution.cpp:83
Methodtop_k_frequent
(nums: Vec<i32>, k: i32)
347. Top K Frequent Elements/src/main.rs:12
Methodtotal_fruit
(tree: Vec<i32>)
Sliding Window/904. Fruit Into Baskets/src/main.rs:8
Methodtotal_n_queens
(n: i32)
52. N-Queens II/src/main.rs:8
Methodtrap
(mut height: Vec<i32>)
42. Trapping Rain Water/src/main.rs:9
Methodtrap
(height: Vec<i32>)
cn/739. 每日温度/src/main.rs:199
Methodtrap2
(height: Vec<i32>)
cn/739. 每日温度/src/main.rs:216
Methodtraverse
200. Number of Islands/Solution.cpp:22
Methodtraverse
99. Recover Binary Search Tree/Solution.cpp:29
Methodtraverse
(root: &Option<Rc<RefCell<TreeNode>>>, res: &mut Vec<i32>)
cn/1305. 两棵二叉搜索树中的所有元素/src/main.rs:56
MethodtwoSum
O(n) using hashmap
1. Two Sum/Solution.cpp:14
Methodtwo_out_of_three
(nums1: Vec<i32>, nums2: Vec<i32>, nums3: Vec<i32>)
2032. Largest Odd Number in String/src/lib.rs:4
Methodtwo_sum
(nums: Vec<i32>, target: i32)
704. 二分查找/src/main.rs:441
Methodtwo_sum
(nums: Vec<i32>, target: i32)
1. Two Sum/src/main.rs:8
Methodunique_paths
(m: i32, n: i32)
62. Unique Paths/src/main.rs:8
Methodunique_paths_with_obstacles
(obstacle_grid: Vec<Vec<i32>>)
63. Unique Paths II/src/main.rs:12
Methodvalid
(board: &Vec<Vec<char>>, i: usize, j: usize)
51. N-Queens/src/main.rs:32
Methodvalid
(board: &Vec<Vec<char>>, i: usize, j: usize, c: char)
37. Sudoku Solver/src/main.rs:48
Methodvalid
(board: &Vec<Vec<char>>, i: usize, j: usize)
52. N-Queens II/src/main.rs:30
Methodvalidate_binary_tree_nodes
(n: i32, left_child: Vec<i32>, right_child: Vec<i32>)
Weekly Contest 177/1361. Validate Binary Tree Nodes/src/main.rs:8
Methodvalidate_binary_tree_nodes_recursive
recursive
Weekly Contest 177/1361. Validate Binary Tree Nodes/src/main.rs:27
Methodvec2node
(vals: &[i32])
23. Merge k Sorted Lists/src/main_bruteforce.rs:93
Functionvery_bad_function
(reference: &T)
1669. Minimum Cost to Cut a Stick/src/main.rs:140
Methodvisit
(l: &Vec<i32>, r: &Vec<i32>, n: usize, v: &mut Vec<bool>)
Weekly Contest 177/1361. Validate Binary Tree Nodes/src/main.rs:34
Functionw1a
()
44. Wildcard Matching/src/main.rs:155
Functionwa
()
18. 4Sum/src/main.rs:64
Functionwa2
()
44. Wildcard Matching/src/main.rs:160
Methodways
(pizza: Vec<String>, k: i32)
1444. Number of Steps to Reduce a Number to Zero/src/main.rs:73
Methodword_pattern
(pattern: String, s: String)
290. Word Pattern/src/main.rs:8
Methodzigzag_level_order
two stack BFS zigzag traverse
Tree/103. Binary Tree Zigzag Level Order Traversal/src/main.rs:34
← previous1,101–1,163 of 1,163, ranked by callers