Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Aloxaf/LeetCode-Rust
/ functions
Functions
279 in github.com/Aloxaf/LeetCode-Rust
⨍
Functions
279
◇
Types & classes
94
Method
level
(op: u8)
src/basic_calculator_ii.rs:4
Method
level_order
(root: Option<Rc<RefCell<TreeNode>>>)
src/binary_tree_level_order_traversal.rs:6
Method
level_order_bottom
(root: Option<Rc<RefCell<TreeNode>>>)
src/binary_tree_level_order_traversal_ii.rs:6
Method
longest_common_prefix
(strs: Vec<String>)
src/longest_common_prefix.rs:2
Method
longest_palindrome
(s: String)
src/longest_palindromic_substring.rs:20
Method
majority_element
摩尔投票算法
src/majority_element.rs:3
Method
majority_element
(nums: Vec<i32>)
src/majority_element_ii.rs:2
Method
max_depth
(root: Option<Rc<RefCell<TreeNode>>>)
src/maximum_depth_of_binary_tree.rs:6
Method
max_sub_array
(nums: Vec<i32>)
src/maximum_subarray.rs:2
Method
merge
(nums1: &mut Vec<i32>, m: i32, nums2: &mut Vec<i32>, n: i32)
src/merge_sorted_array.rs:2
Method
merge_k_lists
基本思路, 存 Vec 里排序 本来准备用优先队列, 想了想感觉也没简单多少? 后来我还是用了优先队列, 因为发现用 std::cmp::Reverse 可以方便地逆转大小关系
src/merge_k_sorted_lists.rs:23
Method
merge_two_lists
( mut l1: Option<Box<ListNode>>, mut l2: Option<Box<ListNode>>, )
src/merge_two_sorted_lists.rs:6
Method
my_atoi
(str: String)
src/string_to_integer_atoi.rs:2
Method
my_pow
(mut x: f64, mut n: i32)
src/powx_n.rs:2
Method
my_pow_bit
(mut x: f64, mut n: i32)
src/powx_n.rs:17
Method
my_pow_builtin
(x: f64, n: i32)
src/powx_n.rs:41
Method
my_pow_normal
(mut x: f64, mut n: i32)
src/powx_n.rs:33
Method
my_sqrt
(x: i32)
src/sqrtx.rs:2
Method
new
(key: i32, val: i32)
src/design_hashmap.rs:30
Method
new
Initialize your data structure here. */
src/add_and_search_word_data_structure_design.rs:15
Method
new
initialize your data structure here. */
src/min_stack.rs:16
Method
new
Initialize your data structure here. */
src/implement_trie_prefix_tree.rs:9
Method
new
Initialize your data structure here. */
src/implement_queue_using_stacks.rs:17
Method
new
Initialize your data structure here. */
src/implement_stack_using_queues.rs:17
Method
new
(val: i32)
src/design_linked_list.rs:20
Function
normal
()
src/powx_n.rs:60
Method
num_jewels_in_stones
(j: String, s: String)
src/jewels_and_stones.rs:2
Method
num_unique_emails
(emails: Vec<String>)
src/unique_email_addresses.rs:4
Method
pair
(c: u8)
src/valid_parentheses.rs:3
Method
permute
(nums: Vec<i32>)
src/permutations.rs:6
Method
plus_one
(mut digits: Vec<i32>)
src/plus_one.rs:2
Method
pop
Removes the element on top of the stack and returns that element. */
src/implement_stack_using_queues.rs:31
Function
pop_insert
(b: &mut Bencher)
src/rotate_array.rs:63
Function
pq
()
src/kth_largest_element_in_an_array.rs:35
Method
product_except_self
assume that nums = [a, b, c, d, e] pass1: nums = [1, a, ab, abc, abcd] pass2: nums = [bcde, cde, de, e, 1] pass1 * pass2: nums = [bcde, acde, abde, ab
src/product_of_array_except_self.rs:6
Method
push
Push element x onto stack. */
src/implement_stack_using_queues.rs:22
Method
put
value will always be non-negative. */
src/design_hashmap.rs:120
Function
recursive
()
src/same_tree.rs:42
Function
recursive
()
src/symmetric_tree.rs:54
Method
remove
Removes the mapping of the specified value key if this map contains a mapping for the key */
src/design_hashmap.rs:138
Method
remove_duplicates
(nums: &mut Vec<i32>)
src/remove_duplicates_from_sorted_array.rs:2
Method
remove_element
(nums: &mut Vec<i32>, val: i32)
src/remove_element.rs:2
Method
remove_elements
(mut head: Option<Box<ListNode>>, val: i32)
src/remove_linked_list_elements.rs:4
Method
remove_nth_from_end
啊! 要被 borrow checker 逼疯了
src/remove_nth_node_from_end_of_list.rs:5
Method
reverse_k_group
https://leetcode.com/problems/reverse-nodes-in-k-group/discuss/11423/Short-but-recursive-Java-code-with-comments
src/reverse_nodes_in_k_group.rs:5
Method
reverse_list
(head: Option<Box<ListNode>>)
src/reverse_linked_list.rs:4
Method
reverse_string
(s: String)
src/reverse_string.rs:2
Method
reverse_string_unsafe
这都不是最快? 第一的大佬究竟用了什么黑魔法...
src/reverse_string.rs:7
Method
roman_to_int
(s: String)
src/roman_to_integer.rs:2
Method
rotate
(matrix: &mut Vec<Vec<i32>>)
src/rotate_image.rs:2
Method
rotate
(nums: &mut Vec<i32>, k: i32)
src/rotate_array.rs:2
Method
rotate_builtin
符合要求, 但是跟 cheat 一样 (
src/rotate_array.rs:16
Method
rotate_drain_append
不符合要求的代码 (不过快一点
src/rotate_array.rs:10
Method
rotate_right_safe
(mut head: Option<Box<ListNode>>, mut k: i32)
src/rotate_list.rs:42
Function
safe
(b: &mut Bencher)
src/rotate_list.rs:134
Method
search
Returns if the word is in the data structure. A word could contain the dot character '.' to represent any one letter. */
src/add_and_search_word_data_structure_design.rs:36
Method
search
Returns if the word is in the trie. */
src/implement_trie_prefix_tree.rs:43
Method
search_insert
(nums: Vec<i32>, target: i32)
src/search_insert_position.rs:2
Method
search_range
(nums: Vec<i32>, target: i32)
src/find_first_and_last_position_of_element_in_sorted_array.rs:3
Method
search_range_builtin
(nums: Vec<i32>, target: i32)
src/find_first_and_last_position_of_element_in_sorted_array.rs:39
Method
self_dividing_numbers
(left: i32, right: i32)
src/self_dividing_numbers.rs:2
Method
single_number
(nums: Vec<i32>)
src/single_number.rs:2
Function
sort
()
src/kth_largest_element_in_an_array.rs:30
Method
sort_array_by_parity
简单粗暴 (
src/sort_array_by_parity.rs:3
Method
spiral_order
(matrix: Vec<Vec<i32>>)
src/spiral_matrix.rs:2
Method
starts_with
Returns if there is any word in the trie that starts with the given prefix. */
src/implement_trie_prefix_tree.rs:48
Method
str_str
(haystack: String, needle: String)
src/implement_strstr.rs:2
Method
str_str_bf
发现暴力也能 0ms 过, 还以为要 KMP. 想想也是....毕竟是简单题
src/implement_strstr.rs:10
Method
subsets
(nums: Vec<i32>)
src/subsets.rs:2
Method
swap_pairs
(mut head: Option<Box<ListNode>>)
src/swap_nodes_in_pairs.rs:4
Function
test
()
src/maximum_subarray.rs:22
Function
test
()
src/majority_element.rs:26
Function
test
()
src/reverse_string.rs:23
Function
test
()
src/single_number.rs:14
Function
test
()
src/self_dividing_numbers.rs:23
Function
test
()
src/two_sum_ii_input_array_is_sorted.rs:25
Function
test
()
src/add_strings.rs:34
Function
test
()
src/remove_duplicates_from_sorted_array.rs:22
Function
test
()
src/permutations.rs:27
Function
test
()
src/basic_calculator_ii.rs:62
Function
test
()
src/roman_to_integer.rs:36
Function
test
()
src/unique_morse_code_words.rs:24
Function
test
()
src/remove_element.rs:23
Function
test
()
src/rotate_image.rs:24
Function
test
()
src/longest_substring_without_repeating_characters.rs:23
Function
test
()
src/sqrtx.rs:21
Function
test
()
src/remove_linked_list_elements.rs:27
Function
test
()
src/swap_nodes_in_pairs.rs:34
Function
test
()
src/spiral_matrix.rs:33
Function
test
()
src/valid_sudoku.rs:72
Function
test
()
src/asteroid_collision.rs:33
Function
test
()
src/majority_element_ii.rs:39
Function
test
()
src/add_and_search_word_data_structure_design.rs:72
Function
test
()
src/flatten_binary_tree_to_linked_list.rs:34
Function
test
()
src/search_insert_position.rs:15
Function
test
()
src/implement_strstr.rs:33
Function
test
()
src/count_primes.rs:23
Function
test
()
src/to_lower_case.rs:14
Function
test
()
src/count_and_say.rs:36
Function
test
()
src/valid_parentheses.rs:33
← previous
next →
101–200 of 279, ranked by callers