Skip to content

This repository is include my LeetCode's problem solution,although some aren't prefect, I will try my best to prefect it.Beside,I will wirte how I solve and its complexity.

License

Notifications You must be signed in to change notification settings

cartoonYu/LeetCodeSolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCodeSolution

English | 简体中文

This repository is include my LeetCode's problem solution,although some aren't prefect, I will try my best to prefect it.Beside,I will write how I solve with English and Chinese and its complexity.

About my leetcode account

My leetcode account : cartoonYu

My leetcode china account : cartoon

Already Solved

7.Reverse Integer

9.Palindrome Number

50.Pow(x, n)

53.Maximum Subarray

67.Add Binary

89.Gray Code

172.Factorial Trailing Zeroes

191.Number of 1 Bits

201.Bitwise AND of Numbers Range

202.Happy Number

204.Count Primes

231.Power of Two

258.Add Digits

263.Ugly Number

319.Bulb Switcher

326.Power of Three

342.Power of Four

367.Valid Perfect Square

396.Rotate Function

398.Random Pick Index

412.Fizz Buzz

476.Number Complement

504.Base 7

507.Perfect Number

693.Binary Number with Alternating Bits

1009.Complement of Base 10 Integer

1018.Binary Prefix Divisible By 5

1232.Check If It Is a Straight Line

1447.Simplified Fractions

1486.XOR Operation in an Array

1.Two Sum

15.3Sum

41.First Missing Positive

42.Trapping Rain Water

48.Rotate Image

118.Pascal's Triangle

164.Maximum Gap

189.Rotate Array

200.Number of Islands

209.Minimum Size Subarray Sum

228.Summary Ranges

268.Missing Number

274.H-Index

283.Move Zeroes

347.Top K Frequent Elements

349.Intersection of Two Arrays

350.Intersection of Two Arrays II

380.Insert Delete GetRandom O(1)

414.Third Maximum Number

423.Reconstruct Original Digits from English

442.Find All Duplicates in an Array

448.Find All Numbers Disappeared in an Array

453.Minimum Moves to Equal Array Elements

455.Assign Cookies

462.Minimum Moves to Equal Array Elements II

463.Island Perimeter

485.Max Consecutive Ones

496.Next Greater Element I

500.Keyboard Row

561.Array Partition I

599.Minimum Index Sum of Two Lists

628.Maximum Product of Three Numbers

643.Maximum Average Subarray I

665.Non-decreasing Array

724.Find Pivot Index

830.Positions of Large Groups

832.Flipping an Image

867.Transpose Matrix

922.Sort Array By Parity II

961.N-Repeated Element in Size 2N Array

989.Add to Array-Form of Integer

1046.Last Stone Weight

1122.Relative Sort Array

1200.Minimum Absolute Difference

1207.Unique Number of Occurrences

1299. Replace Elements with Greatest Element on Right Side

1304.Find N Unique Integers Sum up to Zero

1313.Decompress Run-Length Encoded List

1342.Number of Steps to Reduce a Number to Zero

1351.Count Negative Numbers in a Sorted Matrix

1365.How Many Numbers Are Smaller Than the Current Number

1394.Find Lucky Integer in an Array

1413.Minimum Value to Get Positive Step by Step Sum

1431.Kids With the Greatest Number of Candies

1450.Number of Students Doing Homework at a Given Time

1460.Make Two Arrays Equal by Reversing Sub-arrays

1464.Maximum Product of Two Elements in an Array

1470.Shuffle the Array

1480.Running Sum of 1d Array

1491.Average Salary Excluding the Minimum and Maximum Salary

1502.Can Make Arithmetic Progression From Sequence

1512.Number of Good Pairs

1550.Three Consecutive Odds

1672.Richest Customer Wealth

2342.Max Sum of a Pair With Equal Sum of Digits

2824.Count Pairs Whose Sum is Less than Target

2336.Smallest Number in Infinite Set

2.Add Two Numbers

19.Remove Nth Node From End of List

24.Swap Nodes in Pairs

25.Reverse Nodes in k-Group

61.Rotate List

82.Remove Duplicates from Sorted List II

92.Reverse Linked List II

147.Insertion Sort List

160.Intersection of Two Linked Lists

203.Remove Linked List Elements

206.Reverse Linked List

237.Delete Node in a Linked List

3.Longest Substring Without Repeating Characters

6.ZigZag Conversion

14.Longest Common Prefix

58.Length of Last Word

151.Reverse Words in a String

165.Compare Version Numbers

205.Isomorphic Strings

290.Word Pattern

344.Reverse String

383.Ransom Note

387.First Unique Character in a String

389.Find the Difference

451.Sort Characters By Frequency

482.License Key Formatting

541.Reverse String II

551.Student Attendance Record I

657.Robot Return to Origin

748.Shortest Completing Word

796.Rotate String

844.Backspace String Compare

884.Uncommon Words from Two Sentences

1047.Remove All Adjacent Duplicates In String

1108.Defanging an IP Address

1189.Maximum Number of Balloons

1410.HTML Entity Parser

1422.Maximum Score After Splitting a String

1436.Destination City

1496.Path Crossing

1507.Reformat Date

1528. Shuffle String

1592.Rearrange Spaces Between Words

1614.Maximum Nesting Depth of the Parentheses

1684.Count the Number of Consistent Strings

150.Evaluate Reverse Polish Notation

155.Min Stack

232.Implement Queue using Stacks

94.Binary Tree Inorder Traversal

96.Unique Binary Search Trees

98.Validate Binary Search Tree

100.Same Tree

101.Symmetric Tree

102.Binary Tree Level Order Traversal

103.Binary Tree Zigzag Level Order Traversal

104.Maximum Depth of Binary Tree

105.Construct Binary Tree from Preorder and Inorder Traversal

106.Construct Binary Tree from Inorder and Postorder Traversal

107.Binary Tree Level Order Traversal II

108.Convert Sorted Array to Binary Search Tree

109.Convert Sorted List to Binary Search Tree

110.Balanced Binary Tree

111.Minimum Depth of Binary Tree

112.Path Sum

113.Path Sum II

114.Flatten Binary Tree to Linked List

116.Populating Next Right Pointers in Each Node

124.Binary Tree Maximum Path Sum

129.Sum Root to Leaf Numbers

144.Binary Tree Preorder Traversal

145.Binary Tree Postorder Traversal

173.Binary Search Tree Iterator

199.Binary Tree Right Side View

222. Count Complete Tree Nodes

226.Invert Binary Tree

230.Kth Smallest Element in a BST

235.Lowest Common Ancestor of a Binary Search Tree

257.Binary Tree Paths

404.Sum of Left Leaves

437.Path Sum III

501.Find Mode in Binary Search Tree

513.Find Bottom Left Tree Value

515.Find Largest Value in Each Tree Row

530.Minimum Absolute Difference in BST

538.Convert BST to Greater Tree

654.Maximum Binary Tree

655.Print Binary Tree

687.Longest Univalue Path

700.Search in a Binary Search Tree

783.Minimum Distance Between BST Nodes

938.Range Sum of BST

965.Univalued Binary Tree

1038.Binary Search Tree to Greater Sum Tree

33.Search in Rotated Sorted Array

34.Find First and Last Position of Element in Sorted Array

74.Search a 2D Matrix

153.Find Minimum in Rotated Sorted Array

154.Find Minimum in Rotated Sorted Array II

162.Find Peak Element

278.First Bad Version

374.Guess Number Higher or Lower

744.Find Smallest Letter Greater Than Target

35.Search Insert Position

62.Unique Paths

63.Unique Paths II

119.Pascal's Triangle II

121.Best Time to Buy and Sell Stock

213.House Robber II

221.Maximal Square

279.Perfect Squares

300.Longest Increasing Subsequence

303.Range Sum Query - Immutable

309.Best Time to Buy and Sell Stock with Cooldown

338.Counting Bits

357.Count Numbers with Unique Digits

392.Is Subsequence

509.Fibonacci Number

714.Best Time to Buy and Sell Stock with Transaction Fee

718.Maximum Length of Repeated Subarray

746.Min Cost Climbing Stairs

838.Push Dominoes

1025.Divisor Game

55.Jump Game

134.Gas Station

135.Candy

322.Coin Change

860.Lemonade Change

881.Boats to Save People

1221.Split a String in Balanced Strings

1518.Water Bottles

1710.Maximum Units on a Truck

1725.Number Of Rectangles That Can Form The Largest Square

1736.Latest Time by Replacing Hidden Digits

2216.Minimum Deletions to Make Array Beautiful

17.Letter Combinations of a Phone Number

39.Combination Sum

40.Combination Sum II

46.Permutations

78.Subsets

90.Subsets II

216.Combination Sum III

1137.N-th Tribonacci Number

77.Combinations

175.Combine Two Tables

176.Second Highest Salary

182.Duplicate Emails

184.Department Highest Salary

196.Delete Duplicate Emails

197.Rising Temperature

595.Big Countries

627.Swap Salary

1357.Apply Discount Every n Orders

997.Find the Town Judge

1615.Maximal Network Rank

1114.Print in Order

About

This repository is include my LeetCode's problem solution,although some aren't prefect, I will try my best to prefect it.Beside,I will wirte how I solve and its complexity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages