Leetcode.1743. Why is it so fast to restore the HashMap value of the array from adjacent element pairs?

1, Leetccode1743 multiple processing methods On the third day, I found that the first question in the leetcode question bank was given randomly every day. Two simple questions were given to me two days ago. Today, I came directly to a medium question. Adhering to the ability to cultivate algorithmic thinking and independent thinking, I ...

Added by Wardy7 on Fri, 14 Jan 2022 09:55:30 +0200

[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "palindrome number"

1, Title Requirements Give you an integer X. if x is a palindrome integer, return true; Otherwise, false is returned.Palindromes are integers that are read in the same positive order (from left to right) and reverse order (from right to left). For example, 121 is palindrome, not 123.Example 1: Input: x = 121 Output: true Example 2: Input: ...

Added by renojim on Thu, 13 Jan 2022 19:44:26 +0200

Feng Baobao said: array

Chapter IV: array two 1. Array overview and features two 1.1 concept of array two 1.2 creation of array two 1.2.1 dynamically creating arrays two 1.2.2 statically creating arrays two 1.3 basic operation of array three 1.4 default initialization of array five 1.5 heap and stack in JVM (emphasis) five 2. Common operations of array six 2 ...

Added by ktstowell on Thu, 13 Jan 2022 16:28:53 +0200

Algorithm problem 1: minimum covering substring

1, Problem description Here are two strings S and T. please find the shortest substring containing all the characters in T in S. If there is no such substring, the algorithm returns an empty string; If such a substring is found, the answer can be considered to be unique. 2, Violent solution 1. Algorithm //Violent solution string fun(string ...

Added by mikeyca on Thu, 13 Jan 2022 08:10:15 +0200

Li Kou 904 - fruit basket (dynamic programming)

Title (medium) You are visiting a farm where a row of fruit trees are planted from left to right. These trees are represented by an integer array of fruits, where fruits[i] is the fruit species on the ith tree. You want to collect as many fruits as possible. However, the owner of the farm has set some strict rules. You must pick fruit accordi ...

Added by hypuk on Wed, 12 Jan 2022 20:29:32 +0200

LeetCode 32. Longest valid bracket

Topic Overview: Title link: Ask me to do the problem Problem 1. Unpassable Violence Algorithms _To be honest, the first thing I thought of was this method, but it would exceed the time limit. _Its idea is simple, two-tier loops find each substring, and then use the stack to determine if each substring is a valid substring, which is simpler ...

Added by tinyang on Wed, 12 Jan 2022 19:16:39 +0200

Principle and implementation of ten sorting algorithms [python version]

0 Preface During the algorithm interview, the interviewer will generally ask "what is the time complexity of this algorithm? What is the space complexity? How is its stability?". In order to answer this kind of questions clearly, I combed the basic sorting algorithm. If you master these classical methods, you can do well in the c ...

Added by DimArchon84 on Wed, 12 Jan 2022 09:23:22 +0200

Prepare for the second test, three questions a day, Day05

Prepare for the second test, three questions a day Topic 1: incremental ternary subsequence (leetcode 1.12 daily) Give you an integer array nums to judge whether there is an increasing subsequence with length of 3 in this array. If such a triple subscript (i, j, k) exists and I < J < K is satisfied, so that num [i] < num [J] < nu ...

Added by prestonwinfrey on Wed, 12 Jan 2022 07:09:56 +0200

[link list of Leetcode notes] sword finger Offer 22 The penultimate node in the linked list

😈 Blog home page: 🐼 Hello, everyone. My name is classmate Zhang🐼 πŸ’– Welcome to praise πŸ‘ Collection πŸ’— Leaving a message. πŸ“ Welcome to discuss! πŸ‘€ 🎡 This article was originally written by [Hello, my name is classmate Zhang] and started at CSDN 🌟🌟🌟 ✨ Boutique column (updated from time to time) [data structure + algorithm] [notes][C l ...

Added by barryman9000 on Wed, 12 Jan 2022 06:13:11 +0200

[algorithm - Primary - array] delete duplicate items in the sorting array (implemented in multilingual version)

[algorithm - Primary - array] delete duplicate items in the sorting array (implemented in multilingual version)🌢 Blog description and thanksπŸŽ†πŸŽ†πŸŽ† Part of the information involved in this article comes from the Internet, including my personal summary and views. The purpose of sharing is to build a community and consolidate myself.πŸ’—πŸ’—πŸ’— If t ...

Added by mb81 on Tue, 11 Jan 2022 18:24:54 +0200