Skip to content

sk-g/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

My solutions for problems on Leetcode Currently most solutions will be in Python and I will try to write out solutions in C/C++ as well.

I will probably do a weekly update with more than one approach to problems. If help was taken from some other source, I will post links in the comments of the code, be sure to check them out.

If you would like to contribute create an issue/pull request.

Links

1 Two Sum 37.9% Easy

2 Add Two Numbers 28.6% Medium

3 Longest Substring Without Repeating Characters 24.7% Medium

4 Median of Two Sorted Arrays 23.0% Hard

5 Longest Palindromic Substring 25.3% Medium

6 ZigZag Conversion 27.3% Medium

7 Reverse Integer 24.4% Easy

8 String to Integer (atoi) 14.0% Medium

9 Palindrome Number 35.7% Easy

10 Regular Expression Matching 24.3% Hard

11 Container With Most Water 37.1% Medium

12 Integer to Roman 46.2% Medium

13 Roman to Integer 47.9% Easy

14 Longest Common Prefix 31.6% Easy

15 3Sum 21.8% Medium

16 3Sum Closest 31.6% Medium

17 Letter Combinations of a Phone Number 36.4% Medium

18 4Sum 27.5% Medium

19 Remove Nth Node From End of List 34.0% Medium

20 Valid Parentheses 34.0% Easy

21 Merge Two Sorted Lists 41.0% Easy

22 Generate Parentheses 47.9% Medium

23 Merge k Sorted Lists 28.1% Hard

24 Swap Nodes in Pairs 39.1% Medium

25 Reverse Nodes in k-Group 31.6% Hard

26 Remove Duplicates from Sorted Array 36.3% Easy

27 Remove Element 40.7% Easy

28 Implement strStr() 28.9% Easy

29 Divide Two Integers 15.7% Medium

30 Substring with Concatenation of All Words 22.3% Hard

31 Next Permutation 29.0% Medium

32 Longest Valid Parentheses 23.2% Hard

33 Search in Rotated Sorted Array 31.9% Medium

34 Search for a Range 31.6% Medium

35 Search Insert Position 40.0% Easy

36 Valid Sudoku 37.5% Medium

37 Sudoku Solver 32.0% Hard

38 Count and Say 36.6% Easy

39 Combination Sum 41.3% Medium

40 Combination Sum II 35.9% Medium

41 First Missing Positive 25.8% Hard

42 Trapping Rain Water 37.5% Hard

43 Multiply Strings 28.0% Medium

44 Wildcard Matching 21.0% Hard

45 Jump Game II 26.1% Hard

46 Permutations 47.1% Medium

47 Permutations II 35.0% Medium

48 Rotate Image 41.7% Medium

49 Group Anagrams 38.3% Medium

50 Pow(x, n) 26.0% Medium

51 N-Queens 33.2% Hard

52 N-Queens II 46.7% Hard

53 Maximum Subarray 40.3% Easy

54 Spiral Matrix 27.2% Medium

55 Jump Game 29.5% Medium

56 Merge Intervals 31.9% Medium

57 Insert Interval 28.9% Hard

58 Length of Last Word 32.1% Easy

59 Spiral Matrix II 40.9% Medium

60 Permutation Sequence 29.5% Medium

61 Rotate List 24.4% Medium

62 Unique Paths 42.7% Medium

63 Unique Paths II 32.1% Medium

64 Minimum Path Sum 40.6% Medium

65 Valid Number 12.9% Hard

66 Plus One 39.7% Easy

67 Add Binary 34.0% Easy

68 Text Justification 20.0% Hard

69 Sqrt(x) 28.9% Easy

70 Climbing Stairs 41.2% Easy

71 Simplify Path 26.3% Medium

72 Edit Distance 32.5% Hard

73 Set Matrix Zeroes 36.5% Medium

74 Search a 2D Matrix 34.7% Medium

75 Sort Colors 38.9% Medium

76 Minimum Window Substring 26.7% Hard

77 Combinations 41.2% Medium

78 Subsets 44.6% Medium

79 Word Search 28.1% Medium

80 Remove Duplicates from Sorted Array II 36.8% Medium

81 Search in Rotated Sorted Array II 32.7% Medium

82 Remove Duplicates from Sorted List II 29.9% Medium

83 Remove Duplicates from Sorted List 40.2% Easy

84 Largest Rectangle in Histogram 27.6% Hard

85 Maximal Rectangle 29.6% Hard

86 Partition List 33.5% Medium

87 Scramble String 29.7% Hard

88 Merge Sorted Array 32.1% Easy

89 Gray Code 42.4% Medium

90 Subsets II 38.2% Medium

91 Decode Ways 20.3% Medium

92 Reverse Linked List II 31.3% Medium

93 Restore IP Addresses 28.4% Medium

94 Binary Tree Inorder Traversal 49.6% Medium

95 Unique Binary Search Trees II 32.2% Medium

96 Unique Binary Search Trees 41.9% Medium

97 Interleaving String 25.1% Hard

98 Validate Binary Search Tree 24.1% Medium

99 Recover Binary Search Tree 31.0% Hard

100 Same Tree 47.7% Easy

101 Symmetric Tree 40.3% Easy

102 Binary Tree Level Order Traversal 42.5% Medium

103 Binary Tree Zigzag Level Order Traversal 36.7% Medium

104 Maximum Depth of Binary Tree 54.7% Easy

105 Construct Binary Tree from Preorder and Inorder Traversal 34.0% Medium

106 Construct Binary Tree from Inorder and Postorder Traversal 33.5% Medium

107 Binary Tree Level Order Traversal II 42.1% Easy

108 Convert Sorted Array to Binary Search Tree 44.4% Easy

109 Convert Sorted List to Binary Search Tree 35.6% Medium

110 Balanced Binary Tree 38.4% Easy

111 Minimum Depth of Binary Tree 33.5% Easy

112 Path Sum 34.9% Easy

113 Path Sum II 35.6% Medium

114 Flatten Binary Tree to Linked List 36.5% Medium

115 Distinct Subsequences 32.2% Hard

116 Populating Next Right Pointers in Each Node 36.8% Medium

117 Populating Next Right Pointers in Each Node II 33.9% Medium

118 Pascal's Triangle 40.0% Easy

119 Pascal's Triangle II 38.1% Easy

120 Triangle 34.8% Medium

121 Best Time to Buy and Sell Stock 42.9% Easy

122 Best Time to Buy and Sell Stock II 47.7% Easy

123 Best Time to Buy and Sell Stock III 30.3% Hard

124 Binary Tree Maximum Path Sum 27.1% Hard

125 Valid Palindrome 26.9% Easy

126 Word Ladder II 14.8% Hard

127 Word Ladder 20.0% Medium

128 Longest Consecutive Sequence 38.2% Hard

129 Sum Root to Leaf Numbers 37.7% Medium

130 Surrounded Regions 19.6% Medium

131 Palindrome Partitioning 35.6% Medium

132 Palindrome Partitioning II 24.8% Hard

133 Clone Graph 25.2% Medium

134 Gas Station 30.0% Medium

135 Candy 25.3% Hard

136 Single Number 55.4% Easy

137 Single Number II 42.6% Medium

138 Copy List with Random Pointer 25.9% Medium

139 Word Break 31.4% Medium

140 Word Break II 24.5% Hard

141 Linked List Cycle 35.1% Easy

142 Linked List Cycle II 30.6% Medium

143 Reorder List 26.7% Medium

144 Binary Tree Preorder Traversal 46.8% Medium

145 Binary Tree Postorder Traversal 42.1% Hard

146 LRU Cache 19.7% Hard

147 Insertion Sort List 33.8% Medium

148 Sort List 29.8% Medium

149 Max Points on a Line 15.2% Hard

150 Evaluate Reverse Polish Notation 28.4% Medium

151 Reverse Words in a String 15.6% Medium

152 Maximum Product Subarray 26.7% Medium

153 Find Minimum in Rotated Sorted Array 40.8% Medium

154 Find Minimum in Rotated Sorted Array II 37.8% Hard

155 Min Stack 31.1% Easy

156 Binary Tree Upside Down 45.8% Medium

157 Read N Characters Given Read4 29.0% Easy

158 Read N Characters Given Read4 II - Call multiple times 24.7% Hard

159 Longest Substring with At Most Two Distinct Characters 42.7% Hard

160 Intersection of Two Linked Lists 30.8% Easy

161 One Edit Distance 31.7% Medium

162 Find Peak Element 38.9% Medium

163 Missing Ranges 23.2% Medium

164 Maximum Gap 30.0% Hard

165 Compare Version Numbers 20.8% Medium

166 Fraction to Recurring Decimal 18.1% Medium

167 Two Sum II - Input array is sorted 47.2% Easy

168 Excel Sheet Column Title 27.3% Easy

169 Majority Element 47.9% Easy

170 Two Sum III - Data structure design 26.3% Easy

171 Excel Sheet Column Number 48.4% Easy

172 Factorial Trailing Zeroes 36.9% Easy

173 Binary Search Tree Iterator 43.5% Medium

174 Dungeon Game 24.2% Hard

175 Combine Two Tables 41.3% Easy

176 Second Highest Salary 22.9% Easy

177 Nth Highest Salary 20.7% Medium

178 Rank Scores 29.4% Medium

179 Largest Number 23.4% Medium

180 Consecutive Numbers 27.4% Medium

181 Employees Earning More Than Their Managers 38.7% Easy

182 Duplicate Emails 45.2% Easy

183 Customers Who Never Order 36.5% Easy

184 Department Highest Salary 22.6% Medium

185 Department Top Three Salaries 19.6% Hard

186 Reverse Words in a String II 30.0% Medium

187 Repeated DNA Sequences 33.0% Medium

188 Best Time to Buy and Sell Stock IV 24.9% Hard

189 Rotate Array 25.2% Easy

190 Reverse Bits 29.4% Easy

191 Number of 1 Bits 40.4% Easy

192 Word Frequency 25.8% Medium

193 Valid Phone Numbers 24.6% Easy

194 Transpose File 21.5% Medium

195 Tenth Line 33.5% Easy

196 Delete Duplicate Emails 24.9% Easy

197 Rising Temperature 31.1% Easy

198 House Robber 39.9% Easy

199 Binary Tree Right Side View 42.4% Medium

200 Number of Islands 36.5% Medium

201 Bitwise AND of Numbers Range 34.4% Medium

202 Happy Number 41.5% Easy

203 Remove Linked List Elements 33.4% Easy

204 Count Primes 26.5% Easy

205 Isomorphic Strings 34.7% Easy

206 Reverse Linked List 46.7% Easy

207 Course Schedule 33.7% Medium

208 Implement Trie (Prefix Tree) 30.8% Medium

209 Minimum Size Subarray Sum 32.1% Medium

210 Course Schedule II 30.1% Medium

211 Add and Search Word - Data structure design 25.2% Medium

212 Word Search II 24.7% Hard

213 House Robber II 34.6% Medium

214 Shortest Palindrome 25.1% Hard

215 Kth Largest Element in an Array 40.5% Medium

216 Combination Sum III 47.1% Medium

217 Contains Duplicate 47.0% Easy

218 The Skyline Problem 29.0% Hard

219 Contains Duplicate II 32.8% Easy

220 Contains Duplicate III 18.8% Medium

221 Maximal Square 30.3% Medium

222 Count Complete Tree Nodes 27.7% Medium

223 Rectangle Area 33.7% Medium

224 Basic Calculator 28.6% Hard

225 Implement Stack using Queues 34.3% Easy

226 Invert Binary Tree 53.2% Easy

227 Basic Calculator II 30.1% Medium

228 Summary Ranges 32.0% Medium

229 Majority Element II 29.2% Medium

230 Kth Smallest Element in a BST 45.2% Medium

231 Power of Two 40.7% Easy

232 Implement Queue using Stacks 38.1% Easy

233 Number of Digit One 29.0% Hard

234 Palindrome Linked List 33.4% Easy

235 Lowest Common Ancestor of a Binary Search Tree 39.8% Easy

236 Lowest Common Ancestor of a Binary Tree 30.0% Medium

237 Delete Node in a Linked List 47.2% Easy

238 Product of Array Except Self 50.2% Medium

239 Sliding Window Maximum 34.1% Hard

240 Search a 2D Matrix II 39.1% Medium

241 Different Ways to Add Parentheses 46.0% Medium

242 Valid Anagram 47.4% Easy

243 Shortest Word Distance 53.5% Easy

244 Shortest Word Distance II 41.1% Medium

245 Shortest Word Distance III 51.3% Medium

246 Strobogrammatic Number 40.2% Easy

247 Strobogrammatic Number II 40.9% Medium

248 Strobogrammatic Number III 32.7% Hard

249 Group Shifted Strings 44.1% Medium

250 Count Univalue Subtrees 43.9% Medium

251 Flatten 2D Vector 41.4% Medium

252 Meeting Rooms 48.9% Easy

253 Meeting Rooms II 39.4% Medium

254 Factor Combinations 43.9% Medium

255 Verify Preorder Sequence in Binary Search Tree 41.0% Medium

256 Paint House 46.2% Easy

257 Binary Tree Paths 41.1% Easy

258 Add Digits 51.8% Easy

259 3Sum Smaller 41.9% Medium

260 Single Number III 53.1% Medium

261 Graph Valid Tree 38.4% Medium

262 Trips and Users 19.6% Hard

263 Ugly Number 39.6% Easy

264 Ugly Number II 33.3% Medium

265 Paint House II 38.3% Hard

266 Palindrome Permutation 58.1% Easy

267 Palindrome Permutation II 32.2% Medium

268 Missing Number 45.0% Easy

269 Alien Dictionary 26.3% Hard

270 Closest Binary Search Tree Value 40.6% Easy

271 Encode and Decode Strings 26.0% Medium

272 Closest Binary Search Tree Value II 40.0% Hard

273 Integer to English Words 22.7% Hard

274 H-Index 33.7% Medium

275 H-Index II 34.9% Medium

276 Paint Fence 34.9% Easy

277 Find the Celebrity 35.6% Medium

278 First Bad Version 26.0% Easy

279 Perfect Squares 37.7% Medium

280 Wiggle Sort 58.6% Medium

281 Zigzag Iterator 52.5% Medium

282 Expression Add Operators 30.6% Hard

283 Move Zeroes 51.5% Easy

284 Peeking Iterator 35.5% Medium

285 Inorder Successor in BST 35.6% Medium

286 Walls and Gates 45.3% Medium

287 Find the Duplicate Number 44.3% Medium

288 Unique Word Abbreviation 17.9% Medium

289 Game of Life 37.2% Medium

290 Word Pattern 33.4% Easy

291 Word Pattern II 38.5% Hard

292 Nim Game 55.4% Easy

293 Flip Game 57.2% Easy

294 Flip Game II 47.0% Medium

295 Find Median from Data Stream 29.4% Hard

296 Best Meeting Point 52.3% Hard

297 Serialize and Deserialize Binary Tree 35.0% Hard

298 Binary Tree Longest Consecutive Sequence 41.7% Medium

299 Bulls and Cows 35.9% Medium

300 Longest Increasing Subsequence 38.9% Medium

301 Remove Invalid Parentheses 35.8% Hard

302 Smallest Rectangle Enclosing Black Pixels 46.7% Hard

303 Range Sum Query - Immutable 32.1% Easy

304 Range Sum Query 2D - Immutable 27.1% Medium

305 Number of Islands II 39.7% Hard

306 Additive Number 27.7% Medium

307 Range Sum Query - Mutable 22.4% Medium

308 Range Sum Query 2D - Mutable 25.8% Hard

309 Best Time to Buy and Sell Stock with Cooldown 41.9% Medium

310 Minimum Height Trees 29.0% Medium

311 Sparse Matrix Multiplication 52.4% Medium

312 Burst Balloons 43.6% Hard

313 Super Ugly Number 38.3% Medium

314 Binary Tree Vertical Order Traversal 37.9% Medium

315 Count of Smaller Numbers After Self 35.0% Hard

316 Remove Duplicate Letters 30.4% Hard

317 Shortest Distance from All Buildings 34.8% Hard

318 Maximum Product of Word Lengths 45.6% Medium

319 Bulb Switcher 43.0% Medium

320 Generalized Abbreviation 46.1% Medium

321 Create Maximum Number 24.8% Hard

322 Coin Change 26.6% Medium

323 Number of Connected Components in an Undirected Graph 48.9% Medium

324 Wiggle Sort II 26.4% Medium

325 Maximum Size Subarray Sum Equals k 43.1% Medium

326 Power of Three 40.7% Easy

327 Count of Range Sum 30.6% Hard

328 Odd Even Linked List 44.7% Medium

329 Longest Increasing Path in a Matrix 37.4% Hard

330 Patching Array 32.6% Hard

331 Verify Preorder Serialization of a Binary Tree 37.1% Medium

332 Reconstruct Itinerary 29.9% Medium

333 Largest BST Subtree 31.1% Medium

334 Increasing Triplet Subsequence 39.8% Medium

335 Self Crossing 26.1% Hard

336 Palindrome Pairs 27.1% Hard

337 House Robber III 44.6% Medium

338 Counting Bits 62.2% Medium

339 Nested List Weight Sum 63.8% Easy

340 Longest Substring with At Most K Distinct Characters 38.8% Hard

341 Flatten Nested List Iterator 43.1% Medium

342 Power of Four 39.1% Easy

343 Integer Break 46.5% Medium

344 Reverse String 60.2% Easy

345 Reverse Vowels of a String 39.2% Easy

346 Moving Average from Data Stream 60.2% Easy

347 Top K Frequent Elements 49.6% Medium

348 Design Tic-Tac-Toe 45.9% Medium

349 Intersection of Two Arrays 48.2% Easy

350 Intersection of Two Arrays II 44.4% Easy

351 Android Unlock Patterns 44.7% Medium

352 Data Stream as Disjoint Intervals 41.0% Hard

353 Design Snake Game 27.3% Medium

354 Russian Doll Envelopes 32.5% Hard

355 Design Twitter 25.8% Medium

356 Line Reflection 30.3% Medium

357 Count Numbers with Unique Digits 46.1% Medium

358 Rearrange String k Distance Apart 31.7% Hard

359 Logger Rate Limiter 60.6% Easy

360 Sort Transformed Array 44.9% Medium

361 Bomb Enemy 40.2% Medium

362 Design Hit Counter 55.3% Medium

363 Max Sum of Rectangle No Larger Than K 33.7% Hard

364 Nested List Weight Sum II 54.0% Medium

365 Water and Jug Problem 28.0% Medium

366 Find Leaves of Binary Tree 61.2% Medium

367 Valid Perfect Square 38.7% Easy

368 Largest Divisible Subset 33.8% Medium

369 Plus One Linked List 55.1% Medium

370 Range Addition 57.1% Medium

371 Sum of Two Integers 50.9% Easy

372 Super Pow 34.6% Medium

373 Find K Pairs with Smallest Sums 31.3% Medium

374 Guess Number Higher or Lower 36.6% Easy

375 Guess Number Higher or Lower II 36.1% Medium

376 Wiggle Subsequence 36.1% Medium

377 Combination Sum IV 42.7% Medium

378 Kth Smallest Element in a Sorted Matrix 45.5% Medium

379 Design Phone Directory 36.1% Medium

380 Insert Delete GetRandom O(1) 39.9% Medium

381 Insert Delete GetRandom O(1) - Duplicates allowed 29.5% Hard

382 Linked List Random Node 47.5% Medium

383 Ransom Note 47.8% Easy

384 Shuffle an Array 47.3% Medium

385 Mini Parser 30.9% Medium

386 Lexicographical Numbers 42.3% Medium

387 First Unique Character in a String 47.1% Easy

388 Longest Absolute File Path 37.3% Medium

389 Find the Difference 51.3% Easy

390 Elimination Game 42.6% Medium

391 Perfect Rectangle 27.4% Hard

392 Is Subsequence 44.6% Medium

393 UTF-8 Validation 34.7% Medium

394 Decode String 42.0% Medium

395 Longest Substring with At Least K Repeating Characters 35.7% Medium

396 Rotate Function 33.8% Medium

397 Integer Replacement 30.5% Medium

398 Random Pick Index 44.7% Medium

399 Evaluate Division 42.4% Medium

400 Nth Digit 30.1% Easy

401 Binary Watch 44.8% Easy

402 Remove K Digits 25.9% Medium

403 Frog Jump 32.5% Hard

404 Sum of Left Leaves 47.5% Easy

405 Convert a Number to Hexadecimal 41.1% Easy

406 Queue Reconstruction by Height 56.4% Medium

407 Trapping Rain Water II 37.9% Hard

408 Valid Word Abbreviation 28.4% Easy

409 Longest Palindrome 45.9% Easy

410 Split Array Largest Sum 39.3% Hard

411 Minimum Unique Word Abbreviation 33.8% Hard

412 Fizz Buzz 58.1% Easy

413 Arithmetic Slices 54.6% Medium

414 Third Maximum Number 28.1% Easy

415 Add Strings 41.8% Easy

416 Partition Equal Subset Sum 38.9% Medium

417 Pacific Atlantic Water Flow 34.7% Medium

418 Sentence Screen Fitting 28.3% Medium

419 Battleships in a Board 63.0% Medium

420 Strong Password Checker 19.9% Hard

421 Maximum XOR of Two Numbers in an Array 48.0% Medium

422 Valid Word Square 36.5% Easy

423 Reconstruct Original Digits from English 44.6% Medium

424 Longest Repeating Character Replacement 42.6% Medium

425 Word Squares 43.1% Hard

432 All O`one Data Structure 27.9% Hard

433 Minimum Genetic Mutation 34.8% Medium

434 Number of Segments in a String 36.7% Easy

435 Non-overlapping Intervals 41.2% Medium

436 Find Right Interval 41.5% Medium

437 Path Sum III 40.1% Easy

438 Find All Anagrams in a String 33.9% Easy

439 Ternary Expression Parser 51.3% Medium

440 K-th Smallest in Lexicographical Order 25.6% Hard

441 Arranging Coins 36.4% Easy

442 Find All Duplicates in an Array 56.9% Medium

443 String Compression 36.0% Easy

444 Sequence Reconstruction 19.6% Medium

445 Add Two Numbers II 46.2% Medium

446 Arithmetic Slices II - Subsequence 27.9% Hard

447 Number of Boomerangs 46.6% Easy

448 Find All Numbers Disappeared in an Array 51.1% Easy

449 Serialize and Deserialize BST 42.8% Medium

450 Delete Node in a BST 37.8% Medium

451 Sort Characters By Frequency 51.7% Medium

452 Minimum Number of Arrows to Burst Balloons 44.4% Medium

453 Minimum Moves to Equal Array Elements 48.0% Easy

454 4Sum II 47.5% Medium

455 Assign Cookies 47.2% Easy

456 132 Pattern 28.0% Medium

457 Circular Array Loop 22.1% Medium

458 Poor Pigs 41.8% Easy

459 Repeated Substring Pattern 38.2% Easy

460 LFU Cache 25.0% Hard

461 Hamming Distance 69.6% Easy

462 Minimum Moves to Equal Array Elements II 51.9% Medium

463 Island Perimeter 57.8% Easy

464 Can I Win 25.2% Medium

465 Optimal Account Balancing 39.2% Hard

466 Count The Repetitions 27.3% Hard

467 Unique Substrings in Wraparound String 33.2% Medium

468 Validate IP Address 20.6% Medium

469 Convex Polygon 34.3% Medium

471 Encode String with Shortest Length 43.1% Hard

472 Concatenated Words 30.9% Hard

473 Matchsticks to Square 35.3% Medium

474 Ones and Zeroes 38.8% Medium

475 Heaters 29.7% Easy

476 Number Complement 61.0% Easy

477 Total Hamming Distance 47.6% Medium

479 Largest Palindrome Product 25.4% Easy

480 Sliding Window Median 30.8% Hard

481 Magical String 45.8% Medium

482 License Key Formatting 39.7% Easy

483 Smallest Good Base 33.6% Hard

484 Find Permutation 55.3% Medium

485 Max Consecutive Ones 53.7% Easy

486 Predict the Winner 45.2% Medium

487 Max Consecutive Ones II 45.8% Medium

488 Zuma Game 37.1% Hard

490 The Maze 43.4% Medium

491 Increasing Subsequences 38.9% Medium

492 Construct the Rectangle 48.0% Easy

493 Reverse Pairs 20.9% Hard

494 Target Sum 43.8% Medium

495 Teemo Attacking 51.4% Medium

496 Next Greater Element I 56.5% Easy

498 Diagonal Traverse 46.2% Medium

499 The Maze III 33.9% Hard

500 Keyboard Row 59.9% Easy

501 Find Mode in Binary Search Tree 37.6% Easy

502 IPO 36.6% Hard

503 Next Greater Element II 48.0% Medium

504 Base 7 43.9% Easy

505 The Maze II 38.8% Medium

506 Relative Ranks 46.8% Easy

507 Perfect Number 32.5% Easy

508 Most Frequent Subtree Sum 52.2% Medium

513 Find Bottom Left Tree Value 56.1% Medium

514 Freedom Trail 39.2% Hard

515 Find Largest Value in Each Tree Row 55.4% Medium

516 Longest Palindromic Subsequence 42.8% Medium

517 Super Washing Machines 36.3% Hard

518 Coin Change 2 34.9% Medium

520 Detect Capital 51.9% Easy

521 Longest Uncommon Subsequence I 55.7% Easy

522 Longest Uncommon Subsequence II 32.0% Medium

523 Continuous Subarray Sum 23.3% Medium

524 Longest Word in Dictionary through Deleting 43.2% Medium

525 Contiguous Array 41.4% Medium

526 Beautiful Arrangement 53.3% Medium

527 Word Abbreviation 44.2% Hard

529 Minesweeper 49.4% Medium

530 Minimum Absolute Difference in BST 47.3% Easy

531 Lonely Pixel I 56.3% Medium

532 K-diff Pairs in an Array 28.1% Easy

533 Lonely Pixel II 44.9% Medium

535 Encode and Decode TinyURL 73.8% Medium

536 Construct Binary Tree from String 42.5% Medium

537 Complex Number Multiplication 63.6% Medium

538 Convert BST to Greater Tree 48.7% Easy

539 Minimum Time Difference 46.0% Medium

540 Single Element in a Sorted Array 55.9% Medium

541 Reverse String II 43.8% Easy

542 01 Matrix 32.9% Medium

543 Diameter of Binary Tree 44.9% Easy

544 Output Contest Matches 71.5% Medium

545 Boundary of Binary Tree 32.3% Medium

546 Remove Boxes 35.2% Hard

547 Friend Circles 49.1% Medium

548 Split Array with Equal Sum 37.7% Medium

549 Binary Tree Longest Consecutive Sequence II 42.9% Medium

551 Student Attendance Record I 44.6% Easy

552 Student Attendance Record II 31.6% Hard

553 Optimal Division 55.2% Medium

554 Brick Wall 46.4% Medium

555 Split Concatenated Strings 38.2% Medium

556 Next Greater Element III 29.0% Medium

557 Reverse Words in a String III 60.0% Easy

560 Subarray Sum Equals K 40.1% Medium

561 Array Partition I 66.3% Easy

562 Longest Line of Consecutive One in Matrix 41.4% Medium

563 Binary Tree Tilt 47.2% Easy

564 Find the Closest Palindrome 17.3% Hard

565 Array Nesting 49.3% Medium

566 Reshape the Matrix 57.6% Easy

567 Permutation in String 36.3% Medium

568 Maximum Vacation Days 37.4% Hard

569 Median Employee Salary 37.3% Hard

570 Managers with at Least 5 Direct Reports 58.3% Medium

571 Find Median Given Frequency of Numbers 40.6% Hard

572 Subtree of Another Tree 40.2% Easy

573 Squirrel Simulation 52.3% Medium

574 Winning Candidate 33.6% Medium

575 Distribute Candies 57.9% Easy

576 Out of Boundary Paths 30.6% Medium

577 Employee Bonus 49.5% Easy

578 Get Highest Answer Rate Question 29.2% Medium

579 Find Cumulative Salary of an Employee 28.2% Hard

580 Count Student Number in Departments 39.1% Medium

581 Shortest Unsorted Continuous Subarray 29.1% Easy

582 Kill Process 50.7% Medium

583 Delete Operation for Two Strings 44.4% Medium

584 Find Customer Referee 62.0% Easy

585 Investments in 2016 45.6% Medium

586 Customer Placing the Largest Number of Orders 60.0% Easy

587 Erect the Fence 33.4% Hard

588 Design In-Memory File System 36.1% Hard

591 Tag Validator 30.9% Hard

592 Fraction Addition and Subtraction 46.0% Medium

593 Valid Square 39.8% Medium

594 Longest Harmonious Subsequence 41.1% Easy

595 Big Countries 71.4% Easy

596 Classes More Than 5 Students 30.3% Easy

597 Friend Requests I: Overall Acceptance Rate 38.2% Easy

598 Range Addition II 48.2% Easy

599 Minimum Index Sum of Two Lists 46.4% Easy

600 Non-negative Integers without Consecutive Ones 31.7% Hard

601 Human Traffic of Stadium 33.7% Hard

602 Friend Requests II: Who Has the Most Friends 42.1% Medium

603 Consecutive Available Seats 54.7% Easy

604 Design Compressed String Iterator 33.2% Easy

605 Can Place Flowers 30.1% Easy

606 Construct String from Binary Tree 49.7% Easy

607 Sales Person 51.2% Easy

608 Tree Node 54.1% Medium

609 Find Duplicate File in System 52.1% Medium

610 Triangle Judgement 58.6% Easy

611 Valid Triangle Number 42.0% Medium

612 Shortest Distance in a Plane 51.7% Medium

613 Shortest Distance in a Line 70.1% Easy

614 Second Degree Follower 23.2% Medium

615 Average Salary: Departments VS Company 31.9% Hard

616 Add Bold Tag in String 38.2% Medium

617 Merge Two Binary Trees 67.4% Easy

618 Students Report By Geography 41.7% Hard

619 Biggest Single Number 36.2% Easy

620 Not Boring Movies 59.5% Easy

621 Task Scheduler 42.5% Medium

623 Add One Row to Tree 46.1% Medium

624 Maximum Distance in Arrays 35.2% Easy

625 Minimum Factorization 31.2% Medium

626 Exchange Seats 48.3% Medium

627 Swap Salary 67.3% Easy

628 Maximum Product of Three Numbers 44.7% Easy

629 K Inverse Pairs Array 27.1% Hard

630 Course Schedule III 29.2% Hard

631 Design Excel Sum Formula 27.7% Hard

632 Smallest Range 41.8% Hard

633 Sum of Square Numbers 32.3% Easy

634 Find the Derangement of An Array 35.6% Medium

635 Design Log Storage System 49.4% Medium

636 Exclusive Time of Functions 44.6% Medium

637 Average of Levels in Binary Tree 55.8% Easy

638 Shopping Offers 45.0% Medium

639 Decode Ways II 24.5% Hard

640 Solve the Equation 38.6% Medium

642 Design Search Autocomplete System 31.0% Hard

643 Maximum Average Subarray I 37.5% Easy

644 Maximum Average Subarray II 24.7% Hard

645 Set Mismatch 39.6% Easy

646 Maximum Length of Pair Chain 47.4% Medium

647 Palindromic Substrings 54.9% Medium

648 Replace Words 47.7% Medium

649 Dota2 Senate 36.7% Medium

650 2 Keys Keyboard 44.8% Medium

651 4 Keys Keyboard 49.4% Medium

652 Find Duplicate Subtrees 36.5% Medium

653 Two Sum IV - Input is a BST 50.0% Easy

654 Maximum Binary Tree 69.7% Medium

655 Print Binary Tree 49.4% Medium

656 Coin Path 25.8% Hard

657 Judge Route Circle 68.3% Easy

658 Find K Closest Elements 35.0% Medium

659 Split Array into Consecutive Subsequences 36.9% Medium

660 Remove 9 49.4% Hard

661 Image Smoother 46.2% Easy

662 Maximum Width of Binary Tree 37.9% Medium

663 Equal Tree Partition 36.6% Medium

664 Strange Printer 33.8% Hard

665 Non-decreasing Array 20.3% Easy

666 Path Sum IV 50.3% Medium

667 Beautiful Arrangement II 51.4% Medium

668 Kth Smallest Number in Multiplication Table 39.9% Hard

669 Trim a Binary Search Tree 58.0% Easy

670 Maximum Swap 38.5% Medium

671 Second Minimum Node In a Binary Tree 41.7% Easy

672 Bulb Switcher II 49.5% Medium

673 Number of Longest Increasing Subsequence 31.7% Medium

674 Longest Continuous Increasing Subsequence 42.3% Easy

675 Cut Off Trees for Golf Event 26.9% Hard

676 Implement Magic Dictionary 49.2% Medium

677 Map Sum Pairs 51.6% Medium

678 Valid Parenthesis String 29.4% Medium

679 24 Game 38.6% Hard

680 Valid Palindrome II 32.3% Easy

681 Next Closest Time 42.1% Medium

682 Baseball Game 58.0% Easy

683 K Empty Slots 34.8% Hard

684 Redundant Connection 43.4% Medium

685 Redundant Connection II 28.0% Hard

686 Repeated String Match 32.4% Easy

687 Longest Univalue Path 33.0% Easy

688 Knight Probability in Chessboard 39.7% Medium

689 Maximum Sum of 3 Non-Overlapping Subarrays 41.2% Hard

690 Employee Importance 51.6% Easy

691 Stickers to Spell Word 34.6% Hard

692 Top K Frequent Words 41.2% Medium

693 Binary Number with Alternating Bits 55.5% Easy

694 Number of Distinct Islands 45.1% Medium

695 Max Area of Island 51.7% Easy

696 Count Binary Substrings 50.7% Easy

697 Degree of an Array 46.6% Easy

698 Partition to K Equal Sum Subsets 37.5% Medium

699 Falling Squares 37.0% Hard

711 Number of Distinct Islands II 41.2% Hard

712 Minimum ASCII Delete Sum for Two Strings 51.3% Medium

713 Subarray Product Less Than K 33.1% Medium

714 Best Time to Buy and Sell Stock with Transaction Fee 45.3% Medium

715 Range Module 31.4% Hard

716 Max Stack 37.2% Hard

717 1-bit and 2-bit Characters 49.5% Easy

718 Maximum Length of Repeated Subarray 41.3% Medium

719 Find K-th Smallest Pair Distance 26.9% Hard

720 Longest Word in Dictionary 41.1% Easy

721 Accounts Merge 32.9% Medium

722 Remove Comments 27.9% Medium

723 Candy Crush 55.0% Medium

724 Find Pivot Index 39.4% Easy

725 Split Linked List in Parts 47.5% Medium

726 Number of Atoms 44.0% Hard

727 Minimum Window Subsequence 30.9% Hard

728 Self Dividing Numbers 66.7% Easy

729 My Calendar I 42.3% Medium

730 Count Different Palindromic Subsequences 35.2% Hard

731 My Calendar II 37.7% Medium

732 My Calendar III 50.8% Hard

733 Flood Fill 47.8% Easy

734 Sentence Similarity 38.9% Easy

735 Asteroid Collision 37.2% Medium

736 Parse Lisp Expression 43.1% Hard

737 Sentence Similarity II 41.0% Medium

738 Monotone Increasing Digits 40.7% Medium

739 Daily Temperatures 52.6% Medium

740 Delete and Earn 43.6% Medium

741 Cherry Pickup 23.4% Hard

742 Closest Leaf in a Binary Tree 33.3% Medium

743 Network Delay Time 34.5% Medium

744 Find Smallest Letter Greater Than Target 44.5% Easy

745 Prefix and Suffix Search 24.9% Hard

746 Min Cost Climbing Stairs 43.3% Easy

747 Largest Number At Least Twice of Others 41.9% Easy

748 Shortest Completing Word 52.2% Medium

749 Contain Virus 38.9% Hard

750 Number Of Corner Rectangles 53.5% Medium

751 IP to CIDR 54.7% Easy

752 Open the Lock 38.2% Medium

753 Cracking the Safe 39.7% Hard

754 Reach a Number 26.1% Medium

755 Pour Water 34.0% Medium

756 Pyramid Transition Matrix 45.5% Medium

757 Set Intersection Size At Least Two 34.6% Hard

758 Bold Words in String 37.8% Easy

759 Employee Free Time 52.0% Hard

760 Find Anagram Mappings 75.5% Easy

761 Special Binary String 40.9% Hard

762 Prime Number of Set Bits in Binary Representation 54.9% Easy

763 Partition Labels 64.1% Medium

764 Largest Plus Sign 36.7% Medium

765 Couples Holding Hands 48.0% Hard

766 Toeplitz Matrix 57.6% Easy

767 Reorganize String 35.3% Medium

768 Max Chunks To Make Sorted II 42.3% Hard

769 Max Chunks To Make Sorted 47.7% Medium

770 Basic Calculator IV 43.5% Hard

771 Jewels and Stones 82.3% Easy

772 Basic Calculator III 38.7% Hard

773 Sliding Puzzle 47.7% Hard

774 Minimize Max Distance to Gas Station 29.6% Hard

775 Global and Local Inversions 31.3% Medium

776 Split BST 49.0% Medium

777 Swap Adjacent in LR String 27.1% Medium

778 Swim in Rising Water 44.2% Hard

779 K-th Symbol in Grammar 35.6% Medium

780 Reaching Points 21.6% Hard

781 Rabbits in Forest 49.4% Medium

782 Transform to Chessboard 35.4% Hard

783 Minimum Distance Between BST Nodes 47.4% Easy

784 Letter Case Permutation 52.2% Easy

785 Is Graph Bipartite? 38.8% Medium

786 K-th Smallest Prime Fraction 29.2% Hard

787 Cheapest Flights Within K Stops 30.2% Medium

788 Rotated Digits 50.8% Easy

789 Escape The Ghosts 46.6% Medium

790 Domino and Tromino Tiling 31.7% Medium

791 Custom Sort String 60.2% Medium

792 Number of Matching Subsequences 34.2% Medium

793 Preimage Size of Factorial Zeroes Function 46.2% Hard

794 Valid Tic-Tac-Toe State 27.8% Medium

795 Number of Subarrays with Bounded Maximum 40.3% Medium

796 Rotate String 56.8% Easy

797 All Paths From Source to Target 68.9% Medium

798 Smallest Rotation with Highest Score 30.3% Hard

799 Champagne Tower 28.4% Medium

800 Similar RGB Color 53.1% Easy

801 Minimum Swaps To Make Sequences Increasing 21.6% Medium

802 Find Eventual Safe States 35.0% Medium

803 Bricks Falling When Hit 19.3% Hard

804 Unique Morse Code Words New 80.7% Easy

805 Split Array With Same Average New 19.7% Hard

806 Number of Lines To Write String New 67.0% Easy

807 Max Increase to Keep City Skyline New 83.9% Medium