LeetCode algorithm, daily question, impact Alibaba, day4

1,LeetCode 344. Reverse string subject Write a function that inverts the input string. The input string is given in the form of character array char []. 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. You can assume that all char ...

Added by cbrian on Tue, 15 Feb 2022 02:05:39 +0200

LeetCode -- array

LeetCode brush question array 1, Array 1.1 definition of array An array is a collection of several objects with a certain order. The objects that make up the array are called array elements. Where the vector corresponds to a one-dimensional array and the matrix corresponds to a two-dimensional array. 1.2 storage characteristics of array Ar ...

Added by zMastaa on Mon, 14 Feb 2022 12:56:46 +0200

LeetCode game 280

๐Ÿ“’ Blog home page: A professional who advocates learning technology ๐Ÿฃ Today's article is "game 280 of LeetCode" ๐Ÿฃ ๐Ÿฃ I hope you can finish reading this article patiently ๐Ÿฃ ๐Ÿ™ Bloggers are also in the learning stage. If you find any problems, please let us know. Thank you very much ๐Ÿ™ ๐Ÿ’— At the same time, thank you very much for you ...

Added by Elle0000 on Mon, 14 Feb 2022 03:22:41 +0200

[classic example] binary tree recursive structure classic topic collection @ binary tree

Xiaobian has something to say: these topics are the understanding and application of the recursive traversal structure of binary tree, which are very classic topics. After doing a few steps, you will feel that at present, you can't run away from all the problems. Recursion is just to deal with the current node - it may be to do some oper ...

Added by auamy on Sun, 13 Feb 2022 14:22:02 +0200

LeetCode study - day 35

Day 35 I use C + +, please forgive me for the mistakes. The original intention of this article is only to urge me to study. If I happen to be able to help you, I will be very happy. 1, 1143 Longest common subsequence Give you an integer array of coins to represent coins of different denominations; And an integer amount, representing the t ...

Added by heepofajeep on Sun, 13 Feb 2022 04:03:44 +0200

[YBT2022 winter vacation Day6 C] [luogu CF1063F] substring selection / String Journey (SAM) (line segment tree) (multiplication)

Substring selection / String Journey Title Link: YBT2022 winter vacation Day6 C / luogu CF1063F General idea of the topic Give you a string. If you want to find the maximum K satisfaction, you can choose k disjoint substrings from left to right at a time to meet that the former is the real substring of the latter. thinking First of all, le ...

Added by jrose83 on Sat, 12 Feb 2022 09:10:21 +0200

Leetcode algorithm interview sprint practice 15 (binary search tree)

177. Convert the sorted array into a binary search tree with the lowest height Give a sort array (from small to large) and convert it into a binary search tree with the smallest height. class Solution: """ @param: A: an integer array @return: A tree node """ def sortedArrayToBST(self, A): # write your code her ...

Added by Kunax on Sat, 12 Feb 2022 07:00:32 +0200

Leetcode backtracking typical questions

LC031. Next Permutation 1, Title An arrangement of an integer array is to arrange all its members in sequence or linear order. For example, arr = [1,2,3], the following can be regarded as the arrangement of arr: [1,2,3], [1,3,2], [3,1,2], [2,3,1]. The next permutation of an array of integers refers to the next lexicographically ordered pe ...

Added by tecktalkcm0391 on Sat, 12 Feb 2022 02:26:06 +0200

[LeetCode] - stack and queue

preface When I first know LeetCode and algorithm, I will record my algorithm learning experience in this series of articles. In the early stage, I mainly supervise my learning and clock in. In the later stage, I will slowly add my understanding of knowledge to the articles. I hope you can gain something from reading my articles. The order ...

Added by roscor on Fri, 11 Feb 2022 22:53:55 +0200

Code Capriccio record brush problem introduction binary tree notes

Code Capriccio record brush problem introduction notes Code Capriccio introduction Code Capriccio record brush problem introduction notes 1. You should know this about binary tree! Handout address Binary tree code public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() { } TreeNode(int val) ...

Added by only one on Fri, 11 Feb 2022 20:55:51 +0200