Tag: leetcode
Li Kou [Binary tree topics] 👊 226. Flipping binary trees
February 2, 2024
by Natalie Hale
No Comments
This is the 14th day of my participation in the First Challenge 2022. For details, see: First Challenge 2022. Flip the binary tree - Force...
Read More
The method of “removing mountains” to solve atoi, think clever!
February 2, 2024
by Alex Hussain
No Comments
Today we share LeetCode array and string 4 question: String to integer (ATOI), this "foolish old man" solution, I don't know you have not encountered...
Read More
[Lufy]_leetcode-687- The longest path with the same value
February 2, 2024
by 朱惠婷
No Comments
Given a binary tree, find the longest path. Each node in the path has the same value. This path can go through or not
Read More
LeetCode406. Rebuild the queue according to height
February 2, 2024
by 胡惠雯
No Comments
The question "This is day 3 of my first Text Challenge 2022" assumes that there is an out-of-order group of people standing in a queue....
Read More
[Luffy]_leetcode — Interview questions 16.16 — Part sort
February 2, 2024
by Derek Armstrong
No Comments
Given an integer array, write a function to find the index m and n, as long as the index interval [m,n] elements in order, the...
Read More
LeetCode — Helical matrix (up, down, left, right four-pointer auxiliary method)
February 2, 2024
by Laura Lowery
No Comments
Firstly, four Pointers are defined as shown in the figure below: clockwise, from left to right, from top to bottom, from right to left, and...
Read More
LeetCode implements queues with stacks
February 2, 2024
by Fiona Sanders-Freeman
No Comments
Today's stack implementation of queues is a good question to test the understanding of stacks and queues. Rest assured, in the actual work, are not...
Read More
[luffy]_1342. Number of operations to change a number to 0
February 2, 2024
by 崔惠如
No Comments
Given a non-negative integer num, return the number of steps required to turn it to 0. If the current number is even, you divide it...
Read More
LeetCode 19 removes the NTH node from the list
February 2, 2024
by Lisa Davis
No Comments
This is the seventh day of my participation in the First Challenge 2022. For details: First Challenge 2022. Given a linked list, delete the NTH...
Read More
[Luffy] 16 — LeetCode -[1670] Design front, middle and back queues
February 2, 2024
by Jessica Holland
No Comments
"This is the first day of my participation in the First Challenge 2022. For details: First Challenge 2022." 1670 The whole idea is: for a...
Read More
Rotate Array (Python)
February 2, 2024
by Mannat Mane
No Comments
Rotate Array (Python) Three methods are used to Rotate arrays
Read More
【235. The nearest common ancestor of binary search trees 】
February 2, 2024
by Jorge Coffey
No Comments
This is the 12th day of my participation in the 2022 First Revision Challenge. The nearest common ancestor of binary search tree - LeetCode (leetcode-cn.com)...
Read More
[Luffy] algorithm: 779. The K syntax symbol
February 2, 2024
by Alexis Lewis
No Comments
779. On the first line we write a 0. For each subsequent line, replace the 0 in the previous line with 01 and the 1...
Read More
Delete the penultimate node of the linked list
February 2, 2024
by Shane Wright-Parkinson
No Comments
Given a linked list, delete the NTH node from the bottom of the list and return the head of the list. 1->2->3->4->5, n=2 Create a...
Read More
LeetCode 4. Find the median of two positive ordinal groups
February 2, 2024
by David Gray
No Comments
"This is the second day of my participation in the First Challenge 2022, for more details: First Challenge 2022". Given two positive-ordered (from small to...
Read More
Find All Lonely Numbers in the Array (Python)
February 2, 2024
by Meghan Gonzales
No Comments
This is the third question in the 277 weekly contest. On Medium, it examines the sorting of lists and some basic operations. There is nothing...
Read More
【 interesting algorithm 】1552. Magnetic force between two balls — binary template
February 2, 2024
by Emily Brown
No Comments
Hello, I'm One, welcome to my algorithm channel. Only do interesting algorithms, only write algorithms for interviews. Two shots
Read More
A variety of TopK algorithm implementation
February 2, 2024
by Beverly Lewis
No Comments
I am the front-end watermelon brother, today to complete the TopK algorithm. TopK, that is, find the smallest (or largest) number of k in the...
Read More
[Luffy]_leetcode-763- Delimit letter range
February 2, 2024
by 李馨儀
No Comments
[topic address] [station B address] The string S consists of lowercase letters. We want to divide the string into as many fragments as possible, with...
Read More
LeetCode519. Random inversion matrix
February 2, 2024
by Anika Badami
No Comments
Because n_rows and n_COLs are up to 10^4, you can't open a two-dimensional array because then the space complexity goes back to 10^8. The number...
Read More
Ugly number III — greatest common divisor + dichotomy
February 2, 2024
by Susan Baxter
No Comments
Hello, I'm One, welcome to my algorithm channel. Only do interesting algorithms, only write algorithms for interviews. Question 1201. Ugly number
Read More
Leetcode 2151. Maximum Good People Based on Statements (Python)
February 2, 2024
by Asher Harris
No Comments
This is the fourth question in the 277 weekly contest. It is Hard for me. Maybe it is a brother for the big guy. The...
Read More
[Luffy]_leetcode-164- Maximum spacing
February 2, 2024
by Nayantara Devan
No Comments
[[B station address]] given an unordered array, find the largest difference between adjacent elements of the array. If the number of elements is less than...
Read More
[Luffy]_leetcode-210- Class schedule II
February 2, 2024
by Kiara Manda
No Comments
This is the 13th day of my participation in the 2022 First Courses Challenge. For details, see [B station address]. Now you have numcourses-1
Read More
LeetCode an occasional problem — 832. Flip the image
February 2, 2024
by Prerak Thakkar
No Comments
Scan the QR code below or search for "Teacher Tony's front-end cram school" to follow my wechat official account, and then you can receive my...
Read More
[Lufei]_ programmer must brush force subtitle: interview question 04.12. Summation path
February 2, 2024
by Wendy Carr
No Comments
This is the 8th day of my participation in the 2022 First Revision Challenge. The summation path is given a binary tree in which each...
Read More
Leetcode 2149. Rearrange Array Elements by Sign (Python)
February 2, 2024
by David Myers
No Comments
This is the second question of the 277th weekly competition I just participated in. The difficulty Medium is the flexible use of double Pointers, which...
Read More
Leetcode – The smallest number to rotate the array
February 2, 2024
by Danielle Bowden
No Comments
Moving the beginning elements of an array to the end of the array is called array rotation. Take a rotation of an incrementally sorted array...
Read More
153. Finding minimum values in rotated sorted arrays, binary search, JavaScript, detailed comments
February 2, 2024
by 張惠婷
No Comments
This problem does not have a target value to look up, so that when the left and right Pointers meet, they both point to the...
Read More