This is the 22nd day of my participation in the November update Challenge. The last Update Challenge in 2021. [topic address] [B station address] Example...
Interview questions: Interview questions need to consider specifications, algorithms, code, portability, robustness, etc., so you're comfortable with that before you start
For this problem, we can first look at the corresponding schematic diagram of subsequent traversal, the picture is from the official problem solution. The subsequent...
Given a binary tree, return its backward traversal. This is the 18th day of my participation in the November Gwen Challenge. Example: Advanced: The recursion...
Use DFS to generate all possible permutations. Each layer recursively traverses numS starting with current. The traversed value is stored in a subset and enters...
The Fibonacci sequence can be solved by recursion to dynamic programming. The following is the traversal of dynamic programming, using variables instead of array cache.
Given a string expression s, please implement a basic calculator to calculate and return its value. Integer division preserves only integer parts. The sample
It is possible to take advantage of the nature of strings in JavaScript to quickly produce results by converting integers to strings, regardless of progression....
Checks whether an integer is a palindrome. Palindromes are integers that read in positive (left to right) and backward (right to left) order. An integer...
This is the 20th day of my participation in the November Gwen Challenge. There is a single-threaded CPU running a program containing n functions. Every...
D116 409. Longest Palindrome returns the Longest Palindrome string that can be formed from a given string. Count the number of occurrences with array_count_values. And...
Given a comma-separated sequence, verify that it is the correct preserialization of the binary tree. Write a feasible algorithm without reconstructing the tree. One way...
The elimination method is more consistent with the subtraction thought of binary search algorithm. Each time exclude the target element must not exist in the...
Determine whether a string can be a palindrome with at most one character removed, i.e. read from the beginning and read from the end. link:https://leetcode.com/problems/valid-palindrome