LeetCode notes: Weekly Contest 238
LeetCode notes: Weekly Contest 238
0. Post game summary1. Topic 1
1. Problem solving ideas2. Code implementation 2. Topic 2
1. Problem solving ideas2. Code implementation 3. Topic 3
1. Problem solving ideas2. Code implementation3. Algorithm optimization 4. Topic 4
1. Problem solving ideas2. Code implementation
0. Pos ...
Added by peterj on Fri, 18 Feb 2022 08:11:32 +0200
Java linked list exercises
1, Reversal of linked list (Leedcode.206 reverse linked list)
Reverse a linked list and define two pointers, one to replace the head node and the other to point to the next node. Then, instead of the pointer of the head node, go to the node that needs to be exchanged to carry out the operation similar to the head insertion method, and fi ...
Added by oracle259 on Fri, 18 Feb 2022 03:58:17 +0200
Day2 --- 3 Longest substring without duplicate characters
2021.5.4
Title:
Given a string, please find the length of the longest substring that does not contain duplicate characters.
Example:
input: s = "pwwkew"
output: 3
explain: Because the longest substring without duplicate characters is "wke",So its length is 3.
Please note that your answer must be the length of the substring,"pwke" It' ...
Added by ratcateme on Fri, 18 Feb 2022 00:47:32 +0200
[daily practice of Android spring moves] LeetCode Hot 10 questions
overview
LeetCode Hot: realize Trie (prefix tree), the K largest element in the array, the largest square, flip binary tree, palindrome linked list, the nearest common ancestor of binary tree, the product of arrays other than itself, the maximum value of sliding window, search two-dimensional matrix II and complete square number
LeetCode ...
Added by ganlal on Thu, 17 Feb 2022 17:18:05 +0200
Leetcode Hot100 unskilled topic 32 Longest valid bracket
1. Title Description
Give you a string containing only '(' and '), and find the length of the longest valid (well formed and continuous) bracket substring. Example 1:
Input: s = "(()" Output: 2 Explanation: the longest valid bracket substring is "()" Example 2:
Input: s = ") ()" Output: 4 Explanation: the longes ...
Added by mullz on Thu, 17 Feb 2022 12:48:44 +0200
Problem 16-20202 of reconstructing a difficult tree every day
Title Description
Number of schemes to reconstruct a tree
thinking
Construct the tree and verify the legitimacy of the tree
The first is the second item in the description of scheme number condition in the title. If and only if it means that all number pairs in pairs have ancestor grandson relationship, and all nodes with ancestor g ...
Added by regiemon on Thu, 17 Feb 2022 07:24:47 +0200
[data organization and algorithm] in-depth analysis of the solution idea and algorithm example of "verifying binary search tree"
1, Title Requirements
Give you the root node of a binary tree, root, and judge whether it is an effective binary search tree.A valid binary search tree is defined as follows:
The left subtree of a node contains only the number less than the current node.
The right subtree of a node only contains a number greater than the current node. ...
Added by PhantomCode on Wed, 16 Feb 2022 08:32:07 +0200
LeetCode 540. Single element in ordered array (dichotomy + XOR technique) / 1380 Lucky number in matrix / 1719 Number of schemes to reconstruct a tree
540. A single element in an ordered array
2022.2.14 one question per day
Title Description
Give you an ordered array of integers, where each element will appear twice and only one number will appear once.
Please find and return the number that appears only once.
The solution you design must meet O(log n) time complexity and O(1) space comp ...
Added by mrwutang on Wed, 16 Feb 2022 07:10:49 +0200
Stack containing min function (Sword finger Offer 30)
Title Description: define the data structure of the stack. Please implement a min function that can get the smallest element of the stack in this type. In this stack, the time complexity of calling min, push and pop is O(1).
Problem solving ideas: push and pop methods belong to the basic methods in the stack; The min and top methods return the ...
Added by dapuxter on Tue, 15 Feb 2022 17:04:35 +0200
[daily practice of Android spring moves] LeetCode Hot 5 questions
overview
LeetCode Hot: longest continuous sequence, numbers that appear only once, word splitting, circular linked list, circular linked list II
LeetCode Hot
2.46 longest continuous sequence
Given an unordered integer array nums, find the length of the longest sequence of consecutive numbers (sequence elements are not required to be con ...
Added by kml2katz on Tue, 15 Feb 2022 03:42:59 +0200