[daily question] DP algorithm - change and question + vowel sequence statistics

⭐ New pit in winter vacation -- daily question notes of code Fox 1220. Count the number of vowel sequences - Hard Title Description: Give you an integer n, please help us count how many strings with length n can be formed according to the following rules: Each character in the string should be a lowercase vowel ('a ',' e ',' I ',' o ',' ...

Added by o2cathy on Wed, 19 Jan 2022 21:11:52 +0200

LeetCode-139 - word splitting

Word splitting Title Description: given a non empty string s and a list wordDict containing non empty words, determine whether s can be divided into one or more words in the dictionary by spaces. explain: Words in the dictionary can be reused when splitting. You can assume that there are no duplicate words in the dictionary. See LeetCode's o ...

Added by DF7 on Wed, 19 Jan 2022 18:21:58 +0200

[daily force deduction 24] merge two ordered linked lists

1, Title [LeetCode-21] Merge the two ascending linked lists into a new} ascending linked list and return. The new linked list is composed of all nodes of a given two linked lists.   Example 1: Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2: Input: l1 = [], l2 = [] Output: [] Example 3: Input: l ...

Added by sushiX on Tue, 18 Jan 2022 02:44:20 +0200

5 questions to teach you how to solve the sliding window

preface The so-called window is a continuous closed set, which is generally represented by left and right pointers, but it will also change according to the meaning of the question, such as the following question 187. Repetitive DNA sequences All DNA consists of A series of nucleotides abbreviated as' A ',' C ',' G 'and'T', such as " ...

Added by [-_-] on Mon, 17 Jan 2022 23:53:27 +0200

leetcode question brushing / hash table 438 Find all alphabetic words in the string

438. Find all letter words in the string Meaning: Given two strings S and p, find the substrings of all ectopic words of p in s, and return the starting indexes of these substrings. The order in which answers are output is not considered. Ectopic words refer to strings with the same letters but arranged differently. Example 1: input: ...

Added by landonmkelsey on Mon, 17 Jan 2022 21:24:11 +0200

Reflected Penguin

Title Description You are given two integer arrays nums1 and nums2 in non decreasing order, and two integers m and n representing the number of elements in nums1 and nums2 respectively. Please merge nums2 into nums1 so that the merged array is also arranged in non decreasing order. Title Example Example 1: Input: nums1 = [1,2,3,0,0,0], ...

Added by brandtj on Mon, 17 Jan 2022 11:22:23 +0200

leetcode brush questions / daily questions 138 Copy linked list with random pointer

138. Copy linked list with random pointer Meaning: Give you a linked list with a length of n. each node contains an additional random pointer random, which can point to any node or empty node in the linked list. Construct a deep copy of this linked list. The deep copy should consist of exactly n new nodes, in which the value of each new ...

Added by MasumX on Sun, 16 Jan 2022 16:32:11 +0200

LeetCode -- Target Sum -- backtracking algorithm and dynamic programming -- alloc and mismatch -- the best explanation for non aftereffect and repetitive subproblems

Title Description You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers. For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build th ...

Added by cahamilton on Sun, 16 Jan 2022 01:31:57 +0200

Code Capriccio record: array

preface I use it to record the title of the book written by the boss of my brush code Capriccio (that is, Carl). If there is a self search code Capriccio that I want to learn together, I can. This is an array. The number at the beginning of the title is the serial number of the title in LeetCode. Array article 704. Binary search: This is ...

Added by ishboo on Sat, 15 Jan 2022 01:01:27 +0200

Analysis of leetcode problem solving ideas 735 - 743 questions

Star collision Given an integer array astroids, the planets in the same row are represented. For each element in the array, its absolute value represents the size of the planet, and positive and negative represents the moving direction of the planet (positive represents moving to the right, negative represents moving to the left). Each planet m ...

Added by CrusaderSean on Sat, 15 Jan 2022 00:33:37 +0200