We call array A that meets the following attributes Mountains:
A.length >= 3
There is 0 < I < a.length - 1 such that a [0] < a [1] < A[i-1] < A[i] > A[i+1] > ... > A[A.length - 1]
Given an array determined as mountains, return any that satisfies a [0] < a [1] < A[i-1] < A[i] > A[i+1] > ... > ...
Posted by suaji on Sun, 22 May 2022 10:56:47 +0300
foreword
This is the 20th day of the May training camp. Today's training content is binary search tree.
Problem solving report
1. Force buckle 700
Original title link
700. Searching in Binary Search Trees
Topic overview
Given a binary search tree (BST) root node root and an integer value val.
You need to find the node whose node val ...
Posted by Duncan85 on Fri, 20 May 2022 22:40:36 +0300
Find actual combat
Case 1: sum of two numbers
Given an integer array nums and a target value target, please find the two integers with and as the target value 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 used twice.
Example:
G ...
Posted by onewaylife on Fri, 20 May 2022 12:03:25 +0300
LeetCode algorithm
Most bogey, hope to do a series of articles to record the process of brushing algorithm.
At present, it is mainly based on LeetCode https://leetcode-cn.com/circle/article/48kq9d/ The module of this post will brush the questions.
The content is mainly the summary of the landlord in the post, as well as some personal experience ...
Posted by shak123 on Thu, 19 May 2022 20:46:21 +0300
0. Always say
It's time to pick up your studies that have been neglected for so long. Today is 2022-05-18. Brush at least two questions every day. I've written the first few times and directly abbreviated them.
1. 1. Sum of two numbers
1. Title Description
2. Topic analysis
Traverse to find two numbers with mapping relationship, so y ...
Posted by php3ch0 on Thu, 19 May 2022 01:06:23 +0300
Topic description
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Now given an array of n integers, look for three numbers that add up to 0. Find all the different groups, each group consists of three numbers, and the sum of the t ...
Posted by BlueSkyIS on Wed, 18 May 2022 09:50:36 +0300
Constantly updating
Problem solution
455 distribution of biscuits
Suppose you are a great parent and want to give your children some cookies. However, each child can only give one biscuit at most. For each child i, there is an appetite value gi, which is the minimum size of biscuits that can satisfy the children's appetite; And every cookie ...
Posted by mechamecha on Wed, 18 May 2022 06:40:12 +0300
Digital problem
9. Number of palindromes
Algorithm idea: 1. First, judge whether x is a negative number. If it is a negative number, it directly returns false without conversion 2. Assign the palindrome number y according to the flashback until Y > = X. at this time, if x = = y | x = = Y / 10, it is the palindrome number, otherwise it ...
Posted by elwadhos on Tue, 17 May 2022 18:01:13 +0300
232. Implement queue with stack (simple)
Use the stack to implement the following operations of the queue:
push(x) -- put an element at the end of the queue.
pop() -- removes the element from the queue header.
peek() -- returns the element at the head of the queue.
empty() -- returns whether the queue is empty.
Example:
MyQueue queue = new MyQ ...
Posted by marian on Tue, 17 May 2022 14:29:27 +0300
I spent a few days selecting five topics with the same ideas from the force button to help you solve the problem. If you think the article is useful to you, remember to praise and share it. Let me see your recognition and have the motivation to continue to do it.
467. The unique substring in the surrounding string (medium)
795. Number of int ...
Posted by caspert_ghost on Sat, 14 May 2022 09:02:30 +0300