MCPcopy Create free account

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

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

↓ 205 callersMethodpush
(&mut self, elem: T)
1669. Minimum Cost to Cut a Stick/src/list.rs:21
↓ 157 callersMethoditer
(&self)
1669. Minimum Cost to Cut a Stick/src/main.rs:129
↓ 66 callersMethodpop
(&mut self)
1669. Minimum Cost to Cut a Stick/src/list.rs:30
↓ 46 callersMethodinsert
(mut intervals: Vec<Vec<i32>>, mut new_interval: Vec<i32>)
Merge Intervals/57. Insert Interval/src/main.rs:21
↓ 31 callersMethodremove
(&mut self, n: i32)
Two Heaps/480. Sliding Window Median/src/main.rs:62
↓ 28 callersMethodpush
(&mut self, x: i32)
704. 二分查找/src/main.rs:82
↓ 27 callersMethodpeek
(&self)
1669. Minimum Cost to Cut a Stick/src/list.rs:37
↓ 26 callersMethodinto_iter
(self)
1669. Minimum Cost to Cut a Stick/src/list.rs:49
↓ 22 callersMethodnext
134. Gas Station/Solution.cpp:17
↓ 21 callersMethodseat
(&mut self)
855. Count Unique Characters of All Substrings of a Given String/src/lib.rs:55
↓ 14 callersMethodget
(root: &mut Trie, num: i32, x: i32)
1803. Average Waiting Time/src/lib.rs:29
↓ 10 callersMethoditer_mut
(&mut self)
1669. Minimum Cost to Cut a Stick/src/main.rs:132
↓ 9 callersMethodempty
(&self)
704. 二分查找/src/main.rs:106
↓ 9 callersMethodfind
(&self, mut p: (usize, usize))
Weekly Contest 181/1391. Check if There is a Valid Path in a Grid/src/main.rs:52
↓ 9 callersMethodpop
(&mut self)
704. 二分查找/src/main.rs:86
↓ 8 callersMethodswap
99. Recover Binary Search Tree/Solution.cpp:40
↓ 7 callersMethodcmp
(&self, other: &Self)
23. Merge k Sorted Lists/src/main.rs:82
↓ 7 callersMethodseat
(&mut self)
855. Count Unique Characters of All Substrings of a Given String/src/lib_bkup_ac.rs:15
↓ 6 callersMethodinsert
(&mut self, n: i32)
Two Heaps/480. Sliding Window Median/src/main.rs:47
↓ 6 callersMethodleave
(&mut self, p: i32)
855. Count Unique Characters of All Substrings of a Given String/src/lib.rs:98
↓ 6 callersMethodpow
O(1)
49. Group Anagrams/Solution.cpp:54
↓ 6 callersMethodpush
(&mut self, x: i32)
155. Min Stack/src/main.rs:24
↓ 6 callersMethodunion
(&mut self, p: (usize, usize), q: (usize, usize))
Weekly Contest 181/1391. Check if There is a Valid Path in a Grid/src/main.rs:59
↓ 6 callersFunctionways_to_make_fair
(nums: Vec<i32>)
1664. Find Users With Valid E-Mails/src/lib.rs:1
↓ 5 callersMethodadd_element
(&mut self, num: i32)
1825. Find Minimum Time to Finish All Jobs/src/lib.rs:70
↓ 5 callersMethodfind
(&mut self, x: usize)
1632. Number of Good Ways to Split a String/src/lib.rs:13
↓ 5 callersMethodhas
(&self, p1: (usize, usize), p2: (usize, usize))
1444. Number of Steps to Reduce a Number to Zero/src/main.rs:58
↓ 5 callersMethodreset
(&mut self)
30. Substring with Concatenation of All Words/src/main.rs:178
↓ 5 callersMethodreverse
(s: &mut [char])
704. 二分查找/src/main.rs:279
↓ 5 callersFunctionsquare_sum
()
Two Pointers/202. Happy Number/src/main.rs:45
↓ 4 callersMethodadd_num
(&mut self, num: i32)
Two Heaps/295. Find Median from Data Stream/src/main.rs:32
↓ 4 callersMethodcheckIn
Weekly Contest 182/1396. Design Underground System/Solution.cpp:30
↓ 4 callersMethodcheckOut
Weekly Contest 182/1396. Design Underground System/Solution.cpp:35
↓ 4 callersMethodgetAverageTime
Weekly Contest 182/1396. Design Underground System/Solution.cpp:40
↓ 4 callersFunctionpow
()
1044. Longest Duplicate Substring/src/main.rs:81
↓ 4 callersMethodpow
(x: usize, mut y: usize, modu: usize)
1044. Longest Duplicate Substring/src/main.rs:51
↓ 4 callersMethodseat
(&mut self)
855. Count Unique Characters of All Substrings of a Given String/src/lib_bkup.rs:18
↓ 4 callersMethodsum
( candidates: &[i32], target: i32, buf: &mut Vec<i32>, target_
39. Combination Sum/src/main.rs:18
↓ 3 callersMethodcalculate_mk_average
(&self)
1825. Find Minimum Time to Finish All Jobs/src/lib.rs:88
↓ 3 callersFunctioncount_asterisks
(s: String)
2315. The Change in Global Rankings/src/lib.rs:1
↓ 3 callersMethoddec
(&mut self)
30. Substring with Concatenation of All Words/src/main.rs:172
↓ 3 callersFunctionget_smallest_string
(n: i32, k: i32)
1663. Detect Cycles in 2D Grid/src/lib.rs:1
↓ 3 callersMethodinc
(&mut self)
30. Substring with Concatenation of All Words/src/main.rs:169
↓ 3 callersMethodintersection
(nums1: Vec<i32>, nums2: Vec<i32>)
704. 二分查找/src/main.rs:481
↓ 3 callersFunctionis_palindrome
()
131. Palindrome Partitioning/src/main.rs:50
↓ 3 callersMethodpeek_mut
(&mut self)
1669. Minimum Cost to Cut a Stick/src/list.rs:43
↓ 3 callersMethodpop
Weekly Contest 180/1381. Design a Stack With Increment Operation/Solution.cpp:27
↓ 3 callersMethodtop
(&self)
155. Min Stack/src/main.rs:39
↓ 2 callersMethodbalance
(&mut self)
Two Heaps/480. Sliding Window Median/src/main.rs:86
↓ 2 callersFunctioncal
(w: &Vec<i32>, b: i32)
1815. Checking Existence of Edge Length Limited Paths/src/lib.rs:19
↓ 2 callersFunctioncloneGraph
(node *Node)
133. Clone Graph/solution.go:12
↓ 2 callersMethodcmp
(&self, other: &Self)
855. Count Unique Characters of All Substrings of a Given String/src/lib.rs:40
↓ 2 callersMethodexhausted
(&self)
30. Substring with Concatenation of All Words/src/main.rs:175
↓ 2 callersFunctionfail
()
Two Pointers/457. Circular Array Loop/src/main.rs:75
↓ 2 callersMethodfind_median
(&self)
Two Heaps/295. Find Median from Data Stream/src/main.rs:60
↓ 2 callersMethodget
(&self, index: i32)
704. 二分查找/src/main.rs:600
↓ 2 callersMethodget
(&self, i: usize)
Dynamic Programming/321. Create Maximum Number/src/main.rs:92
↓ 2 callersMethodi2o
(&mut self)
704. 二分查找/src/main.rs:142
↓ 2 callersMethodinc_expect
(&mut self)
30. Substring with Concatenation of All Words/src/main.rs:166
↓ 2 callersMethodisPart
93. Restore IP Addresses/Solution.cpp:12
↓ 2 callersMethodleave
(&mut self, p: i32)
855. Count Unique Characters of All Substrings of a Given String/src/lib_bkup_ac.rs:35
↓ 2 callersMethodlowestCommonAncestor
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/discuss/65225/4-lines-C%2B%2BJavaPythonRuby
Tree/236. Lowest Common Ancestor of a Binary Tree/Solution.cpp:16
↓ 2 callersFunctionmerge_k_lists
(mut lists: Vec<Option<Box<ListNode>>>)
1669. Minimum Cost to Cut a Stick/src/main.rs:414
↓ 2 callersFunctionmerge_two_lists
( mut list1: Option<Box<ListNode>>, mut list2: Option<Box<ListNode>>, )
1669. Minimum Cost to Cut a Stick/src/main.rs:461
↓ 2 callersFunctionprint_type_of
(_: &T)
1759. Find the Missing IDs/src/main.rs:30
↓ 2 callersMethodpush
Weekly Contest 180/1381. Design a Stack With Increment Operation/Solution.cpp:22
↓ 2 callersFunctiontestA
(a: &mut A)
1759. Find the Missing IDs/src/main.rs:51
↓ 1 callersFunctiona
()
1825. Find Minimum Time to Finish All Jobs/src/lib.rs:29
↓ 1 callersMethodbt
22. Generate Parentheses/Solution.cpp:53
↓ 1 callersMethodbuildTree
105. Construct Binary Tree from Preorder and Inorder Traversal/Solution.cpp:42
↓ 1 callersMethodcal
(&mut self, i:usize, j:usize)
44. Wildcard Matching/src/main.rs:98
↓ 1 callersMethodcheckValidString
678. Valid Parenthesis String/Solution.cpp:16
↓ 1 callersMethodcon
Weekly Contest 178/1367. Linked List in Binary Tree/Solution.cpp:33
↓ 1 callersMethodconnected
(&self, p: (usize, usize), q: (usize, usize))
Weekly Contest 181/1391. Check if There is a Valid Path in a Grid/src/main.rs:72
↓ 1 callersMethodcontainsNearbyDuplicate
219. Contains Duplicate II/Solution.cpp:16
↓ 1 callersFunctioncount_nice_pairs
(nums: Vec<i32>)
1814. Jump Game VI/src/lib.rs:1
↓ 1 callersMethodfindDisappearedNumbers
448. Find All Numbers Disappeared in an Array/Solution.cpp:10
↓ 1 callersMethodfindMaxLength
525. Contiguous Array/Solution.cpp:16
↓ 1 callersMethodgenerateTheString
Weekly Contest 179/1374. Generate a String With Characters That Have Odd Counts/Solution.cpp:14
↓ 1 callersMethodgenp
22. Generate Parentheses/Solution.cpp:17
↓ 1 callersMethodgetIntersectionNode
two pointers */
160. Intersection of Two Linked Lists/Solution.cpp:14
↓ 1 callersMethodget_res
(&self)
Tree/113. Path Sum II/src/main.rs:49
↓ 1 callersMethodgrayCode
it requires prior knowledge: the graycode can be converted from normal binary for n bits labeled from n-1, n-2, .. 0, here is the formula: GrayBit(i)
89. Gray Code/Solution.cpp:17
↓ 1 callersFunctiongreatest_letter
(s: String)
2309. Maximize Number of Subsequences in a String/src/lib.rs:1
↓ 1 callersMethodgroupAnagrams
49. Group Anagrams/Solution.cpp:19
↓ 1 callersFunctionhelper
(node: &Option<Rc<RefCell<TreeNode>>>, ret: &mut Vec<i32>)
1669. Minimum Cost to Cut a Stick/src/main.rs:505
↓ 1 callersMethodhi
(self)
1759. Find the Missing IDs/src/main.rs:72
↓ 1 callersMethodi
(&self)
32. Longest Valid Parentheses/src/main.rs:90
↓ 1 callersMethodinit
28. Implement strStr()/Solution.cpp:21
↓ 1 callersMethodipFromNPart
93. Restore IP Addresses/Solution.cpp:18
↓ 1 callersMethodisValidBST
98. Validate Binary Search Tree/Solution.cpp:28
↓ 1 callersMethodis_match
(s: S, p: S)
44. Wildcard Matching/src/main.rs:66
↓ 1 callersMethoditer
(&self)
1669. Minimum Cost to Cut a Stick/src/list.rs:53
↓ 1 callersMethoditer_mut
(&mut self)
1669. Minimum Cost to Cut a Stick/src/list.rs:57
↓ 1 callersMethodjudgePoint24
679. 24 Game/Solution.cpp:25
↓ 1 callersMethodleave
(&mut self, p: i32)
855. Count Unique Characters of All Substrings of a Given String/src/lib_bkup.rs:39
↓ 1 callersMethodlongestPrefix
Rabin-Karp s contains only lowercase English letters. notice **longest** !
Weekly Contest 181/1392. Longest Happy Prefix/Solution.cpp:65
↓ 1 callersMethodmaxPerformance
Weekly Contest 180/1383. Maximum Performance of a Team/Solution.cpp:27
↓ 1 callersMethodmaxPoints
how to use 2 integers to represent a double if 0 -> up = 0, do not represent inf if has sign, sign is on the up
149. Max Points on a Line/Solution.cpp:35
↓ 1 callersMethodmaxProfit
reasonalbe : easy to reasion about
121. Best Time to Buy and Sell Stock/Solution.cpp:51
next →1–100 of 1,163, ranked by callers