MCPcopy Create free account

hub / github.com/aylei/leetcode-rust / types & classes

Types & classes271 in github.com/aylei/leetcode-rust

↓ 2 callersClassNode
head value and the index
src/solution/s0023_merge_k_sorted_lists.rs:30
↓ 1 callersClassLine
src/solution/s0149_max_points_on_a_line.rs:64
ClassBSTIterator
非递归中序遍历 */
src/solution/s0173_binary_search_tree_iterator.rs:53
ClassCodeDefinition
src/fetcher.rs:118
ClassData
src/fetcher.rs:149
ClassDifficulty
src/fetcher.rs:204
ClassInterval
src/solution/s0056_merge_intervals.rs:31
ClassInterval
src/solution/s0057_insert_interval.rs:32
ClassInvert
src/solution/s0295_find_median_from_data_stream.rs:50
ClassInvert
src/solution/s0313_super_ugly_number.rs:36
ClassLRUCache
src/solution/s0146_lru_cache.rs:67
ClassLRUEntry
Entry is either a map entry and a link-list node
src/solution/s0146_lru_cache.rs:49
ClassListNode
src/util/linked_list.rs:2
ClassMedianFinder
src/solution/s0295_find_median_from_data_stream.rs:66
ClassMinStack
这题居然是 easy... 我怀疑人生了, getMin() 怎么能做到常数时间? Heap 也是 LogN 啊 看了最高票解之后...........天哪, 我可太菜了 核心思想是保证每次 pop 时都能以常数时间更新最小值, 这就需要在空间上以某种方式记录下来 那一种做法就是存储每个元素和
src/solution/s0155_min_stack.rs:53
ClassMyQueue
src/solution/s0232_implement_queue_using_stacks.rs:40
ClassMyStack
src/solution/s0225_implement_stack_using_queues.rs:40
ClassNumArray
src/solution/s0307_range_sum_query_mutable.rs:44
ClassNumArray
src/solution/s0303_range_sum_query_immutable.rs:30
ClassNumMatrix
src/solution/s0304_range_sum_query_2d_immutable.rs:42
ClassPoint
src/util/point.rs:2
ClassProblem
src/fetcher.rs:104
ClassProblems
src/fetcher.rs:166
ClassQuery
src/fetcher.rs:126
ClassQuestion
src/fetcher.rs:154
ClassRawProblem
src/fetcher.rs:144
ClassSolution
* [__PROBLEM_ID__] __PROBLEM_TITLE__ * * __PROBLEM_DESC__ */
template.rs:6
ClassSolution
* [113] Path Sum II * * Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. * * Note: A leaf is
src/solution/s0113_path_sum_ii.rs:32
ClassSolution
* [33] Search in Rotated Sorted Array * * Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. * * (i.e.
src/solution/s0033_search_in_rotated_sorted_array.rs:28
ClassSolution
* [210] Course Schedule II * * There are a total of n courses you have to take, labeled from 0 to n-1. * * Some courses may have prerequisites, fo
src/solution/s0210_course_schedule_ii.rs:37
ClassSolution
* [15] 3Sum * * Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array
src/solution/s0015_3sum.rs:23
ClassSolution
* [228] Summary Ranges * * Given a sorted integer array without duplicates, return the summary of its ranges. * * Example 1: * * * Input: [0,1
src/solution/s0228_summary_ranges.rs:23
ClassSolution
* [29] Divide Two Integers * * Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.
src/solution/s0029_divide_two_integers.rs:31
ClassSolution
* [38] Count and Say * * The count-and-say sequence is the sequence of integers with the first five terms as following: * * * 1. 1 * 2
src/solution/s0038_count_and_say.rs:38
ClassSolution
* [8] String to Integer (atoi) * * Implement <code><span>atoi</span></code> which converts a string to an integer. * * The function first disc
src/solution/s0008_string_to_integer_atoi.rs:62
ClassSolution
* [89] Gray Code * * The gray code is a binary numeral system where two successive values differ in only one bit. * * Given a non-negative int
src/solution/s0089_gray_code.rs:39
ClassSolution
* [307] Range Sum Query - Mutable * * Given an integer array nums, find the sum of the elements between indices i and j (i &le; j), inclusive. * *
src/solution/s0307_range_sum_query_mutable.rs:26
ClassSolution
* [131] Palindrome Partitioning * * Given a string s, partition s such that every substring of the partition is a palindrome. * * Return all possi
src/solution/s0131_palindrome_partitioning.rs:20
ClassSolution
* [1] Two Sum * * Given an array of integers, return indices of the two numbers such that they * add up to a specific target. * * You may assume
src/solution/s0001_two_sum.rs:19
ClassSolution
* [81] Search in Rotated Sorted Array II * * Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. * * (i
src/solution/s0081_search_in_rotated_sorted_array_ii.rs:31
ClassSolution
* [189] Rotate Array * * Given an array, rotate the array to the right by k steps, where k is non-negative. * * Example 1: * * * Input:
src/solution/s0189_rotate_array.rs:34
ClassSolution
* [206] Reverse Linked List * * Reverse a singly linked list. * * Example: * * * Input: 1->2->3->4->5->NULL * Output: 5->4->3->2->1->NULL *
src/solution/s0206_reverse_linked_list.rs:18
ClassSolution
* [61] Rotate List * * Given a linked list, rotate the list to the right by k places, where k is non-negative. * * Example 1: * * * Input: 1->2
src/solution/s0061_rotate_list.rs:28
ClassSolution
* [23] Merge k Sorted Lists * * Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. * * Example: *
src/solution/s0023_merge_k_sorted_lists.rs:19
ClassSolution
* [295] Find Median from Data Stream * * Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle
src/solution/s0295_find_median_from_data_stream.rs:40
ClassSolution
* [169] Majority Element * * Given an array of size n, find the majority element. The majority element is the element that appears more than &lfloor
src/solution/s0169_majority_element.rs:22
ClassSolution
* [204] Count Primes * * Count the number of prime numbers less than a non-negative number, n. * * Example: * * * Input: 10 * Output: 4 * Exp
src/solution/s0204_count_primes.rs:15
ClassSolution
* [75] Sort Colors * * Given an array with n objects colored red, white or blue, sort them <a href="https://en.wikipedia.org/wiki/In-place_algorithm
src/solution/s0075_sort_colors.rs:25
ClassSolution
* [167] Two Sum II - Input array is sorted * * Given an array of integers that is already sorted in ascending order, find two numbers such that they
src/solution/s0167_two_sum_ii_input_array_is_sorted.rs:23
ClassSolution
* [301] Remove Invalid Parentheses * * Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible
src/solution/s0301_remove_invalid_parentheses.rs:29
ClassSolution
* [11] Container With Most Water * * Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical
src/solution/s0011_container_with_most_water.rs:23
ClassSolution
* [71] Simplify Path * * Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. * *
src/solution/s0071_simplify_path.rs:58
ClassSolution
* [257] Binary Tree Paths * * Given a binary tree, return all root-to-leaf paths. * * Note: A leaf is a node with no children. * * Example: *
src/solution/s0257_binary_tree_paths.rs:24
ClassSolution
* [79] Word Search * * Given a 2D board and a word, find if the word exists in the grid. * * The word can be constructed from letters of sequentia
src/solution/s0079_word_search.rs:24
ClassSolution
* [221] Maximal Square * * Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. * *
src/solution/s0221_maximal_square.rs:19
ClassSolution
* [292] Nim Game * * You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turn
src/solution/s0292_nim_game.rs:17
ClassSolution
* [73] Set Matrix Zeroes * * Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it <a href="https://en.wikipedia.org/w
src/solution/s0073_set_matrix_zeroes.rs:49
ClassSolution
* [282] Expression Add Operators * * Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operato
src/solution/s0282_expression_add_operators.rs:40
ClassSolution
* [202] Happy Number * * Write an algorithm to determine if a number is "happy". * * A happy number is a number defined by the following process:
src/solution/s0202_happy_number.rs:20
ClassSolution
* [3] Longest Substring Without Repeating Characters * * Given a string, find the length of the longest substring without repeating characters. *
src/solution/s0003_longest_substring_without_repeating_characters.rs:13
ClassSolution
* [224] Basic Calculator * * Implement a basic calculator to evaluate a simple expression string. * * The expression string may contain open ( and
src/solution/s0224_basic_calculator.rs:34
ClassSolution
* [50] Pow(x, n) * * Implement <a href="http://www.cplusplus.com/reference/valarray/pow/" target="_blank">pow(x, n)</a>, which calculates x raised
src/solution/s0050_powx_n.rs:36
ClassSolution
* [102] Binary Tree Level Order Traversal * * Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, l
src/solution/s0102_binary_tree_level_order_traversal.rs:28
ClassSolution
* [219] Contains Duplicate II * * Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array
src/solution/s0219_contains_duplicate_ii.rs:34
ClassSolution
* [27] Remove Element * * Given an array nums and a value val, remove all instances of that value <a href="https://en.wikipedia.org/wiki/In-place_
src/solution/s0027_remove_element.rs:50
ClassSolution
* [59] Spiral Matrix II * * Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. * * Example:
src/solution/s0059_spiral_matrix_ii.rs:19
ClassSolution
* [84] Largest Rectangle in Histogram * * Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, fi
src/solution/s0084_largest_rectangle_in_histogram.rs:26
ClassSolution
* [164] Maximum Gap * * Given an unsorted array, find the maximum difference between the successive elements in its sorted form. * * Return 0 if t
src/solution/s0164_maximum_gap.rs:31
ClassSolution
* [99] Recover Binary Search Tree * * Two elements of a binary search tree (BST) are swapped by mistake. * * Recover the tree without changing
src/solution/s0099_recover_binary_search_tree.rs:56
ClassSolution
* [37] Sudoku Solver * * Write a program to solve a Sudoku puzzle by filling the empty cells. * * A sudoku solution must satisfy all of the fo
src/solution/s0037_sudoku_solver.rs:31
ClassSolution
* [132] Palindrome Partitioning II * * Given a string s, partition s such that every substring of the partition is a palindrome. * * Return the mi
src/solution/s0132_palindrome_partitioning_ii.rs:17
ClassSolution
* [91] Decode Ways * * A message containing letters from A-Z is being encoded to numbers using the following mapping: * * * 'A' -> 1 * 'B' -> 2
src/solution/s0091_decode_ways.rs:31
ClassSolution
* [179] Largest Number * * Given a list of non negative integers, arrange them such that they form the largest number. * * Example 1: * * * Inp
src/solution/s0179_largest_number.rs:22
ClassSolution
* [216] Combination Sum III * * <div> * Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9
src/solution/s0216_combination_sum_iii.rs:29
ClassSolution
* [263] Ugly Number * * Write a program to check whether a given number is an ugly number. * * Ugly numbers are positive numbers whose prime facto
src/solution/s0263_ugly_number.rs:38
ClassSolution
* [58] Length of Last Word * * Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last wor
src/solution/s0058_length_of_last_word.rs:17
ClassSolution
* [60] Permutation Sequence * * The set [1,2,3,...,n] contains a total of n! unique permutations. * * By listing and labeling all of the permu
src/solution/s0060_permutation_sequence.rs:41
ClassSolution
* [86] Partition List * * Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to
src/solution/s0086_partition_list.rs:16
ClassSolution
* [35] Search Insert Position * * Given a sorted array and a target value, return the index if the target is found. If not, return the index where
src/solution/s0035_search_insert_position.rs:37
ClassSolution
* [226] Invert Binary Tree * * Invert a binary tree. * * Example: * * Input: * * * 4 * / \ * 2 7 * / \ / \ * 1 3 6
src/solution/s0226_invert_binary_tree.rs:32
ClassSolution
* [43] Multiply Strings * * Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represen
src/solution/s0043_multiply_strings.rs:29
ClassSolution
* [69] Sqrt(x) * * Implement int sqrt(int x). * * Compute and return the square root of x, where x is guaranteed to be a non-negative integer. *
src/solution/s0069_sqrtx.rs:27
ClassSolution
* [47] Permutations II * * Given a collection of numbers that might contain duplicates, return all possible unique permutations. * * Example: *
src/solution/s0047_permutations_ii.rs:19
ClassSolution
* [205] Isomorphic Strings * * Given two strings s and t, determine if they are isomorphic. * * Two strings are isomorphic if the characters i
src/solution/s0205_isomorphic_strings.rs:33
ClassSolution
* [239] Sliding Window Maximum * * Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the v
src/solution/s0239_sliding_window_maximum.rs:29
ClassSolution
* [127] Word Ladder * * Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence
src/solution/s0127_word_ladder.rs:48
ClassSolution
* [212] Word Search II * * Given a 2D board and a list of words from the dictionary, find all words in the board. * * Each word must be constructe
src/solution/s0212_word_search_ii.rs:35
ClassSolution
* [124] Binary Tree Maximum Path Sum * * Given a non-empty binary tree, find the maximum path sum. * * For this problem, a path is defined as any
src/solution/s0124_binary_tree_maximum_path_sum.rs:35
ClassSolution
* [63] Unique Paths II * * A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). * * The robot can
src/solution/s0063_unique_paths_ii.rs:34
ClassSolution
* [198] House Robber * * You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the
src/solution/s0198_house_robber.rs:26
ClassSolution
* [300] Longest Increasing Subsequence * * Given an unsorted array of integers, find the length of longest increasing subsequence. * * Example: *
src/solution/s0300_longest_increasing_subsequence.rs:23
ClassSolution
* [120] Triangle * * Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. *
src/solution/s0120_triangle.rs:24
ClassSolution
* [97] Interleaving String * * Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. * * Example 1: * * * Input: s1 = "
src/solution/s0097_interleaving_string.rs:21
ClassSolution
* [207] Course Schedule * * There are a total of n courses you have to take, labeled from 0 to n-1. * * Some courses may have prerequisites, f
src/solution/s0207_course_schedule.rs:36
ClassSolution
* [40] Combination Sum II * * Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in c
src/solution/s0040_combination_sum_ii.rs:40
ClassSolution
* [107] Binary Tree Level Order Traversal II * * Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from lef
src/solution/s0107_binary_tree_level_order_traversal_ii.rs:28
ClassSolution
* [1127] Last Stone Weight * * We have a collection of rocks, each rock has a positive integer weight. * * Each turn, we choose the two heaviest r
src/solution/s1046_last_stone_weight.rs:37
ClassSolution
* [171] Excel Sheet Column Number * * Given a column title as appear in an Excel sheet, return its corresponding column number. * * For exampl
src/solution/s0171_excel_sheet_column_number.rs:40
ClassSolution
* [223] Rectangle Area * * Find the total area covered by two rectilinear rectangles in a 2D plane. * * Each rectangle is defined by its bottom le
src/solution/s0223_rectangle_area.rs:21
ClassSolution
* [114] Flatten Binary Tree to Linked List * * Given a binary tree, flatten it to a linked list in-place. * * For example, given the following tre
src/solution/s0114_flatten_binary_tree_to_linked_list.rs:33
next →1–100 of 271, ranked by callers