1. Question 5 of the longest palindrome substring force deduction
Substring: substring must be continuous, which is different from the concept of subsequence
Where the violent solution can be optimized: palindromes are judged only when the length of the substring is > the current maximum length,
Is there anything that can be ...
Posted by bmyster on Tue, 21 Sep 2021 11:14:33 +0200
Breadth first search traversal, also known as BFS, belongs to blind search method. It is one of the search algorithms of graph. The purpose is to systematically expand and check all nodes in the graph to find results. In other words, it does not consider the possible location of the result and searches the whole graph thoroughly until it finds ...
Posted by AffApprentice on Tue, 21 Sep 2021 01:26:55 +0200
1. Where the dream begins - the sum of two numbers Given an integer array nums and an integer target value target, please find the two integers with and as the target value target in the array and return their array subscripts.
You can assume that each input will correspond to only one answer. However, the same element in the array cannot be r ...
Posted by umguy on Mon, 20 Sep 2021 08:56:59 +0200
3. Longest string without duplicate characters Method 1. Violence solution Generate substrings one by one See if it does not contain duplicate characters Method 2. Sliding window and optimization Do not repeat from a to C. when a repeats, the left pointer moves one bit to the right The right pointer moves one bit to the right Double pointer JA ...
Posted by parawizard on Mon, 20 Sep 2021 07:57:47 +0200
Given an n-element ordered (ascending) integer array nums and a target value target, write a function to search the target in nums. If the target value exists, return the subscript, otherwise return - 1.
Input: num = [- 1,0,3,5,9,12], target = 9, output: 4 Explanation: 9 appears in nums and the sub ...
Posted by EXiT on Sun, 19 Sep 2021 13:36:21 +0200
93. Restore IP address LeetCode
Released: 21:26:11, September 18, 2021
Problem description and examples
Given a string containing only numbers to represent an IP address, return all valid IP addresses that may be obtained from s. You can return answers in any order. A valid IP address consists of exactly four integers (each integer is bet ...
Posted by timbuckthree on Sun, 19 Sep 2021 09:49:09 +0200
43. String multiplication
Give two nonnegative integers in string form num1 and Num2, return num1 and num2 Their products are also expressed in string form.
Input: num1 = "2", num2 = "3" Output: "6"
Input: num1 = "123", num ...
Posted by Fearpig on Sun, 19 Sep 2021 09:39:55 +0200
Given a different set of words, find all the different index pairs (i, j) so that two words in the list, words[i] + words[j], can be stitched together into palindrome strings.
Input: words = ["abcd","dcba","lls","s","sssll"]
Interpretation: A spliceable palindrome string is ["dcbaabcd","abcddcba"," ...
Posted by Helios on Sat, 18 Sep 2021 22:04:25 +0200
189. Medium difficulty: the content refers to the official answer
Think of the array as a ring connected end to end. Moving right is equivalent to rotating the ring Requirements: 1. Use the in-situ algorithm with spatial complexity O(1) to solve this problem; 2. There are at least three different ways to solve this problem
Problem solving ide ...
Posted by dunnsearch on Fri, 17 Sep 2021 04:04:11 +0200
Title: 239. Maximum value of sliding window
Reference problem solution: Maximum value of sliding window - Official solution of force buckle
The simplest way is to solve it violently. The time complexity is
Posted by fxpepper on Sat, 11 Sep 2021 20:07:04 +0200