Prepare for the second test, three questions a day, Day25
Prepare for the second test, three questions a day
Topic 1: delete nodes in the linked list
Please write a function to delete a specific node in the single linked list. When designing the function, you should pay attention to that you cannot access the head node of the linked list. You can only directly access the node to be deleted.
The top ...
Added by aminnuto on Wed, 02 Feb 2022 17:55:45 +0200
C++&Python description LeetCode 1 Sum of two numbers
C + + & Python description LeetCode 1 Sum of two numbers
Hello, I'm q í gu ā n ji e, sharing some technical posts in the official account, CSDN, GitHub, B station, HUAWEI Developer Forum and so on. It's not hard to give up, but persistence must be cool! Time flies, the future can be expected, come on~
If you love b ...
Added by gardan06 on Wed, 02 Feb 2022 12:21:19 +0200
Analysis and application of binary search
Look at leetcode
Given an array containing n positive integers and a positive integer target.
Find out the continuous sub array [numsl, numsl+1,..., numsr-1, numsr] with the smallest length satisfying its sum ≥ target in the array, and return its length. If there is no eligible subarray, 0 is returned. Example 1: Input: target = 7, Num ...
Added by sharugan on Tue, 01 Feb 2022 23:19:04 +0200
JAVA exercise 71 - longest substring
When the uppercase and lowercase forms of each letter contained in a string s , appear in s , at the same time, the string s , is called a beautiful string. For example, "abABB" is a beautiful string, because 'a' and 'a' appear at the same time, and 'B' and 'B' appear at the same time. However, "abA" is not a good string ...
Added by googlit on Tue, 01 Feb 2022 22:04:27 +0200
Interval DP: Gene splicing
5 (optional) gene splicing (100 points) Gene splicing is the joining of different DNA fragments. The existing n DNA fragments line up from left to right. Each time two adjacent DNA fragments were selected and stitched into a longer DNA fragment. The last DNA fragment was adjacent to the first. Repeat this process until all the DNA fragments for ...
Added by dookie on Tue, 01 Feb 2022 17:50:26 +0200
High frequency question brushing - binary search topic
There are many binary search questions in leecode. Generally speaking, when a topic has the following characteristics, you should immediately associate it with the possibility of using binary search:
The array to be searched is ordered or partially orderedThe time complexity is required to be lower than O(n), or the time complexity is directly ...
Added by mbeals on Tue, 01 Feb 2022 14:15:34 +0200
leetcode day 19 - 884438713209
Day 19
884 unusual words in two sentences
A sentence is a string of words separated by spaces. Each word consists of only lowercase letters.
If a word happens to appear once in one sentence but does not appear in the other sentence, the word is not common.
Give you two sentences s1 and s2 and return a list of all the infrequently used words ...
Added by mahakmx on Tue, 01 Feb 2022 13:01:53 +0200
[daily question] sliding window + depth search + bit operation - Happy race week and happy New Year
⭐ New pit in winter vacation -- daily question notes of code Fox
5993. Multiply the value found by 2-week question 1
Give you an integer array nums, and give you an integer original, which is the first number to search in nums.
Next, you need to follow the following steps:
If the original is found in nums, multiply the original by 2 to g ...
Added by doctor_james on Tue, 01 Feb 2022 08:57:33 +0200
Li Kou Day20 (happy New Year's Eve)
344,Reverse string
Write a function that inverts the input string. The input string is given as a character array s.
Do not allocate additional space to another array. You must modify the input array in place and use the additional space of O(1) to solve this problem.
class Solution {
public void reverseString(char[] s) {
...
Added by toibs on Tue, 01 Feb 2022 08:13:59 +0200
Notes on the general algorithm for the sum of Leecode K numbers (taking the sum of four numbers as an example)
Sum of K numbers
Title Description: give you an array composed of any N numbers. Given a target value target, it is required to find K numbers so that the sum of these K numbers is target. It is required to output the combination of all k digits that meet this condition, and the combination shall not be repeated
(take K=4 as an example)
I ...
Added by knobby2k on Tue, 01 Feb 2022 00:45:07 +0200