#Python
464 posts
LintCode 971 Surplus Value Backpack - Hard
971. Surplus Value Backpack
LintCode 960 First Unique Number In Data Stream II - Medium
960. First Unique Number in Data Stream II
LintCode 92 Backpack - Medium
描述
LintCode 90 K Sum II - Medium
90. k Sum II
LintCode 89 K Sum - Hard
89. k Sum
LintCode 845 Greatest Common Divisor - Easy
845. Greatest Common Divisor
LintCode 843 Digits Flip - Medium
LintCode 841 String Replace - Hard
841. String Replace
LintCode 839 Merge Two Sorted Interval Lists - Easy
839. Merge Two Sorted Interval Lists
LintCode 816 Traveling Salesman Problem - Hard
816. Traveling Salesman Problem
LintCode 761 Smallest Subset - Medium
761. Smallest Subset
LintCode 752 Rogue Knight Sven - Medium
752. 流浪剑客斯温
LintCode 724 Minimum Partition - Medium
724. Minimum Partition
LintCode 685 First Unique Number In Data Stream - Medium
685. First Unique Number in Data Stream
LintCode 680 Split String - Medium
680. Split String
LintCode 654 Sparse Matrix Multiplication - Medium
654. Sparse Matrix Multiplication
LintCode 630 Knight Shortest Path II - Medium
630. Knight Shortest Path II
LintCode 628 Maximum Subtree - Easy
628. Maximum Subtree
LintCode 625 Partition Array II - Medium
625. Partition Array II
LintCode 612 K Closest Points - Medium
612. K Closest Points
LintCode 611 Knight Shortest Path-II - Medium
611. Knight Shortest Path
LintCode 610 Two Sum-Difference Equals To Target - Medium
610. Two Sum - Difference equals to target
LintCode 61 Search For A Range - Medium
61. Search for a Range
LintCode 609 Two Sum-Less Than Or Eqaul To Target - Medium
609. Two Sum - Less than or equal to target
LintCode 604 Window Sum - Easy
604. Window Sum
LintCode 6 Merge Two Sorted Arrays - Easy
6. 合并排序数组 II
LintCode 596 Minimum Subtree - Easy
596. Minimum Subtree
LintCode 585 Maximum Number In Mountain Sequence - Medium
585. Maximum Number in Mountain Sequence
LintCode 584 Drop Eggs II - Medium
584. Drop Eggs II
LintCode 578 Lowest Common Ancestor III - Medium
578. Lowest Common Ancestor III
LintCode 577 Merge K Sorted Interval Lists - Medium
577. Merge K Sorted Interval Lists
LintCode 563 Backpack V - Medium
描述
LintCode 560 Friendship Service - Easy
560. Friendship Service
LintCode 553 Two Sum-Closest To Target - Medium
533. Two Sum - Closest to target
LintCode 545 Top K Largest Numbers II - Medium
545. Top k Largest Numbers II
LintCode 538 Memcache - Medium
538. Memcache
LintCode 522 Tiny URLII - Medium
522. Tiny Url II
LintCode 521 Remove Duplicate Numbers In Array - Easy
521. Remove Duplicate Numbers in Array
LintCode 502 Mini Cassandra - Medium
502. Mini Cassandra
LintCode 494 Implement Stack By Two Queues - Easy
494. Implement Stack by Two Queues
LintCode 492 Implement Queue By Linked List - Easy
492. Implement Queue by Linked List
LintCode 49 Sort Letters By Case - Medium
49. Sort Letters by Case
LintCode 474 Lowest Common Ancestor II - Easy
474. Lowest Common Ancestor II
LintCode 464 Sort Integers II - Easy
464. 整数排序 II
LintCode 462 Total Occurrence Of Target - Easy
462. Total Occurrence of Target
LintCode 461 Kth Smallest Numbers In Unsorted Array - Medium
Find the kth smallest number in an unsorted integer array.
LintCode 460 Find K Closest Elements - Medium
460. Find K Closest Elements
LintCode 458 Last Position Of Target - Easy
458. Last Position of Target
LintCode 447 Search In A Big Sorted Array - Medium
447. Search in a Big Sorted Array
LintCode 443 Two Sum-Greater Than Target - Medium
443. Two Sum - Greater than target
LintCode 440 Backpack III - Medium
给定 n 种物品, 每种物品都有无限个. 第 i 个物品的体积为 A[i], 价值为 V[i].
LintCode 437 Copy Books - Medium
给定 n 本书, 第 i 本书的页数为 pages[i]. 现在有 k 个人来复印这些书籍, 而每个人只能复印编号连续的一段的书, 比如一个人可以复印 pages[0], pages[1], pages[2], 但是不可以只复印 pages[0], pages[2], pa…
LintCode 40 Implement Queue By Two Stacks - Medium
40. Implement Queue by Two Stacks
LintCode 396 Coin In Line III - Hard
有 n 个硬币排成一条线, 第 i 枚硬币的价值为 values[i].
LintCode 394 Coin In Line - Medium
描述
LintCode 39 Recover Rotated Sorted Array - Easy
39. Recover Rotated Sorted Array
LintCode 38 Search A2 D Matrix II - Medium
38. Search a 2D Matrix II
LintCode 373 Partition Arrayby Oddand Even - Easy
373. Partition Array by Odd and Even
LintCode 254 Drop Eggs - Easy
254. Drop Eggs
LintCode 249 Count Smaller Number Before Itself - Hard
Description
LintCode 235 Prime Factorization - Easy
235. Prime Factorization
LintCode 211 String Permutation - Easy
211. String Permutation
LintCode 197 Permutation Index - Medium
197. Permutation Index
LintCode 1870 Number Of Substrings With All Zeroes - Medium
1870. number of substrings with all zeroes
LintCode 183 Wood Cut - Hard
183. Wood Cut
LintCode 1790 Rotate String II - Easy
1790. Rotate String II
LintCode 1479 Can Reach The Endpoint - Easy
1479. Can Reach The Endpoint
LintCode 144 Interleaving Positive And Negative Numbers - Medium
144. Interleaving Positive and Negative Numbers
LintCode 143 Sort Colors II - Medium
LintCode 140 Fast Power - Medium
140. Fast Power
LintCode 14 First Position Of Target - Easy
14. First Position of Target
LintCode 1375 Substring With At Least K Distinct Characters - Medium
1375. Substring With At Least K Distinct Characters
LintCode 1343 Sum Of Two Strings - Easy
1343. Sum of Two Strings
LintCode 1331 English Software - Easy
1331. English Software
LintCode 130 Heapify - Medium
130. Heapify
LintCode 129 Rehashing - Medium
129. Rehashing
LintCode 128 Hash Function - Easy
128. Hash Function
LintCode 127 Topological Sorting - Medium
127. Topological Sorting
LintCode 125 Backpack II - Medium
有 n 个物品和一个大小为 m 的背包. 给定数组 A 表示每个物品的大小和数组 V 表示每个物品的价值.
LintCode 120 Word Ladder - Hard
120. Word Ladder
LintCode 1166 Recommended Results Are Scattered - Easy
1166. Recommended Results are Scattered
LintCode 10 String Permutations II - Medium
10. String Permutation II
LeetCode 994 Rotting Oranges - Medium
994. Rotting Oranges -- Medium
LeetCode 991 Broken Calculator - Medium
991. Broken Calculator -- Medium
LeetCode 987 Vertical Order Traversal Of A Binary Tree - Medium
987. Vertical Order Traversal of a Binary Tree -- Medium
LeetCode 986 Interval List Intersections - Medium
986. Interval List Intersections
LeetCode 983 Minimum Cost For Tickets - Medium
983. Minimum Cost For Tickets -- Medium
LeetCode 981 Time Based Key Value Store - Medium
981. Time Based Key-Value Store -- Medium
LeetCode 98 Valid Binary Search Tree - Medium
98. Validate Binary Search Tree -- Medium
LeetCode 977 Squares Of A Sorted Array - Easy
Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing…
LeetCode 974 Subarray Sums Divisible By K - Medium
974. Subarray Sums Divisible by K -- Medium
LeetCode 973 K Closest Points To Origin - Medium
973. K Closest Points to Origin -- Medium
LeetCode 97 Interleaving String - Hard
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
LeetCode 969 Pancake Sorting - Medium
969. Pancake Sorting
LeetCode 96 Unique Binary Search Trees - Medium
96. Unique Binary Search Trees -- Medium
LeetCode 958 Check Completeness Of A Binary Tree - Medium
958. Check Completeness of a Binary Tree -- Medium
LeetCode 950 Reveal Cards In Increasing Order - Medium
950. Reveal Cards In Increasing Order -- Medium
LeetCode 95 Unique Binary Search Trees II - Medium
95. Unique Binary Search Trees II -- Medium
LeetCode 94 Binary Tree Inorder Traversal - Medium
94. Binary Tree Inorder Traversal
LeetCode 937 Reorder Data In Log Files - Easy
937. Reorder Data in Log Files
LeetCode 931 Minimum Falling Path Sum - Medium
931. Minimum Falling Path Sum -- Medium
LeetCode 924 Minimize Malware Spread - Hard
924. Minimize Malware Spread -- Hard
LeetCode 92 Reverse Linked List II - Medium
92. Reverse Linked List II
LeetCode 914 X Of A Kind In A Deck Of Cards - Easy
914. X of a Kind in a Deck of Cards -- Easy
LeetCode 912 Sort An Array - Medium
Given an array of integers nums, sort the array in ascending order.
LeetCode 91 Decode Ways - Medium
A message containing letters from A-Z is being encoded to numbers using the following mapping:
LeetCode 905 Sort Array By Parity - Easy
905. Sort Array By Parity
LeetCode 889 Construct Binary Tree From Preorder And Postorder Traversal - Medium
889. Construct Binary Tree from Preorder and Postorder Traversal
LeetCode 887 Super Egg Drop - Hard
887. Super Egg Drop
LeetCode 883 Find And Replace In String - Medium
833. Find And Replace in String
LeetCode 881 Boats To Save People - Medium
881. Boats to Save People -- Medium
LeetCode 88 Merge Sorted Array - Easy
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
LeetCode 870 Advantage Shuffle - Medium
870. Advantage Shuffle -- Medium
LeetCode 87 Scramble String - Hard
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
LeetCode 864 Shortest Path To Get All Keys - Hard
864. Shortest Path to Get All Keys -- Hard
LeetCode 863 All Nodes Distance K In Binary Tree - Medium
863. All Nodes Distance K in Binary Tree -- Medium
LeetCode 86 Partition List - Medium
86. Partition List
LeetCode 856 Score Of Parentheses - Medium
856. Score of Parentheses -- Medium
LeetCode 853 Car Fleet - Medium
853. Car Fleet -- Medium
LeetCode 852 Peak Index In A Mountain Array - Easy
852. Peak Index in a Mountain Array
LeetCode 850 Rectangle Area II - Hard
850. Rectangle Area II -- Hard
LeetCode 85 Maximal Rectangle - Hard
85. Maximal Rectangle -- Hard
LeetCode 837 New21 Game - Medium
837. New 21 Game -- Medium
LeetCode 83 Remove Duplicates From Sorted List - Easy
83. Remove Duplicates from Sorted List
LeetCode 829 Consecutive Numbers Sum - Hard
829. Consecutive Numbers Sum -- Hard
LeetCode 827 Making A Large Island - Hard
827. Making A Large Island -- Hard
LeetCode 822 Card Flipping Game - Medium
822. Card Flipping Game -- Medium
LeetCode 82 Remove Duplicates From Sorted List II - Medium
82. Remove Duplicates from Sorted List II
LeetCode 819 Most Common Word - Easy
819. Most Common Word
LeetCode 811 Subdomain Visits - Easy
811. Subdomain Visit Count -- Easy
LeetCode 796 Rotate String - Easy
796. Rotate String -- Easy
LeetCode 79 Word Search - Medium
79. Word Search -- Medium
LeetCode 786 Kth Smallest Prime Fraction - Hard
786. K-th Smallest Prime Fraction -- Hard
LeetCode 785 Is Graph Bipatite - Medium
785. Is Graph Bipartite? -- Medium
LeetCode 78 Subsets - Medium
17. Subsets
LeetCode 777 Swap Adjacent In LR String - Medium
777. Swap Adjacent in LR String -- Medium
LeetCode 772 Basic Calculator III - Hard
772. Basic Calculator III -- Hard
LeetCode 771 Jewels And Stones - Easy
You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is …
LeetCode 767 Reorganize String - Medium
767. Reorganize String -- Medium
LeetCode 763 Partition Labels - Medium
763. Partition Labels
LeetCode 76 Minimum Window Substring - Hard
76. Minimum Window Substring -- Hard
LeetCode 759 Employee Free Time - Hard
759. Employee Free Time -- Hard
LeetCode 75 Sort Colors - Medium
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the col…
LeetCode 741 Cherry Pickup - Hard
741. Cherry Pickup -- Hard
LeetCode 74 Search A2 D Matrix - Medium
74. Search a 2D Matrix
LeetCode 735 Asteroid Collision - Medium
735. Asteroid Collision -- Medium
LeetCode 726 Number Of Atoms - Hard
726. Number of Atoms -- Hard
LeetCode 723 Candy Crush - Medium
723. Candy Crush -- Medium
LeetCode 72 Edit Distance - Hard
Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.
LeetCode 716 Max Stack - Easy
716. Max Stack
LeetCode 713 Subarray Product Less Than K - Medium
713. Subarray Product Less Than K -- Medium
LeetCode 706 Design Hash Map - Easy
706. Design HashMap -- Easy
LeetCode 704 Binary Search - Easy
Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If ta…
LeetCode 703 Kth Largest Element In A Stream - Easy
703. Kth Largest Element in a Stream
LeetCode 70 Climbing Stairs - Easy
70. Climbing Stairs -- Easy
LeetCode 698 Partition To K Equal Sum Subsets - Medium
698. Partition to K Equal Sum Subsets -- Medium
LeetCode 697 Degree Of An Array - Easy
LeetCode 695 Max Area Of Island - Medium
695. Max Area of Island -- Medium
LeetCode 692 Top K Frequent Words - Medium
692. Top K Frequent Words
LeetCode 682 Maximum Product Of Three Numbers - Easy
628. Maximum Product of Three Numbers -- Easy
LeetCode 681 Next Closest Time - Medium
681. Next Closest Time -- Medium
LeetCode 680 Valid Palindrome II - Easy
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.
LeetCode 68 Text Justification - Hard
68. Text Justification -- Hard
LeetCode 679 24 Game - Hard
679. 24 Game -- Hard
LeetCode 674 Longest Continuous Increasing Subsequence - Easy
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).
LeetCode 670 Maximum Swap - Medium
670. Maximum Swap -- Medium
LeetCode 67 Add Binary - Easy
67. Add Binary -- Easy
LeetCode 662 Maximum Width Of Binary Tree - Medium
662. Maximum Width of Binary Tree -- Medium
LeetCode 66 Plus One - Easy
66. Plus One
LeetCode 658 Find K Closest Elements - Medium
658. Find K Closest Elements
LeetCode 647 Palindromic Substrings - Medium
647. Palindromic Substrings
LeetCode 64 Minimum Path Sum - Medium
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers alo…
LeetCode 63 Unique Paths II - Medium
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
LeetCode 621 Task Scheduler - Medium
621. Task Scheduler -- Medium
LeetCode 62 Unique Paths - Medium
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
LeetCode 611 Valid Triangle Number - Medium
611. Valid Triangle Number
LeetCode 61 Rotate List - Medium
61. Rotate List -- Medium
LeetCode 589 N-ary Tree Preorder Traversal - Easy
589. N-ary Tree Preorder Traversal -- Easy
LeetCode 582 Kill Process - Medium
582. Kill Process -- Medium
LeetCode 581 Shortest Unsorted Continuous Subarray - Easy
581. Shortest Unsorted Continuous Subarray
LeetCode 58 Length Of Last Word - Easy
58. Length of Last Word
LeetCode 567 Permutation In String - Medium
567. Permutation in String -- Medium
LeetCode 561 Array Partition I - Easy
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which …
LeetCode 56 Merge Intervals - Medium
56. Merge Intervals
LeetCode 55 Jump Game - Medium
Given an array of non-negative integers, you are initially positioned at the first index of the array.
LeetCode 547 Friend Circles - Medium
547. Friend Circles
LeetCode 545 Boundary Of Binary Tree - Medium
545. Boundary of Binary Tree -- Medium
LeetCode 543 Diameter Of Binary Tree - Easy
543. Diameter of Binary Tree -- Easy
LeetCode 542 01 Matrix - Medium
542. 01 Matrix
LeetCode 535 Encode And Decode Tiny URL - Medium
535. Encode and Decode TinyURL
LeetCode 529 Minesweeper - Medium
529. Minesweeper -- Medium
LeetCode 528 Random Pick With Weight - Medium
528. Random Pick with Weight -- Medium
LeetCode 526 Beautiful Arrangement - Medium
526. Beautiful Arrangement
LeetCode 523 Continuous Subarray Sum - Medium
523. Continuous Subarray Sum -- Medium
LeetCode 52 N-Queens II - Hard
52. N-Queens II
LeetCode 518 Coin Change II - Medium
518. Coin Change 2 -- Medium
LeetCode 516 Longest Palindromic Subsequence - Medium
516. Longest Palindromic Subsequence
LeetCode 51 N-Queens - Hard
51. N-Queens
LeetCode 509 Fibonacci Number - Easy
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two …
LeetCode 500 Keyboard Row - Easy
500. Keyboard Row -- Easy
LeetCode 50 Pow(x,n) - Medium
50. Pow(x, n)
LeetCode 493 Reverse Pairs - Hard
493. Reverse Pairs -- Hard
LeetCode 49 Group Anagrams - Medium
Given an array of strings, group anagrams together.
LeetCode 485 Max Consecutive Ones - Easy
Given a binary array, find the maximum number of consecutive 1s in this array.
LeetCode 48 Rotate Image - Medium
48. Rotate Image
LeetCode 474 Onesand Zeroes - Medium
Given an array, strs, with strings consisting of only 0s and 1s. Also two integers m and n.
LeetCode 470 Implement Rand10()Using Rand7() - Medium
470. Implement Rand10() Using Rand7() -- Medium
LeetCode 47 Permutations II - Medium
47. Permutations II
LeetCode 465 Optimal Account Balancing - Hard
465. Optimal Account Balancing -- Hard
LeetCode 463 Island Perimeter - Easy
463. Island Perimeter -- Easy
LeetCode 454 4 Sum II - Medium
454. 4Sum II
LeetCode 451 Sort Characters By Frequency - Medium
451. Sort Characters By Frequency -- Medium
LeetCode 450 Delete Node In ABST - Medium
450. Delete Node in a BST -- Medium
LeetCode 449 Serialize And Deserialize BST - Medium
449. Serialize and Deserialize BST
LeetCode 448 Find All Numbers Disappered In An Array - Easy
448. Find All Numbers Disappeared in an Array -- Easy
LeetCode 445 Add Two Numbers II - Medium
445. Add Two Numbers II -- Medium
LeetCode 441 Arranging Coins - Easy
441. Arranging Coins -- Easy
LeetCode 440 Kth Smallest In Lexicographical Order - Hard
440. K-th Smallest in Lexicographical Order -- Hard
LeetCode 44 Wildcard Mathcing - Hard
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.
LeetCode 437 Path Sum III - Medium
437. Path Sum III -- Medium
LeetCode 430 Flatten A Multilevel Doubly Linked List - Medium
430. Flatten a Multilevel Doubly Linked List -- Medium
LeetCode 43 Multiply Strings - Medium
43. Multiply Strings -- Medium
LeetCode 424 Longest Repeating Character Replacement - Medium
424. Longest Repeating Character Replacement
LeetCode 42 Tapping Rain Water - Hard
42. Trapping Rain Water
LeetCode 417 Pacific Atlantic Water Flow - Medium
417. Pacific Atlantic Water Flow -- Medium
LeetCode 415 Add Strings - Easy
415. Add Strings -- Easy
LeetCode 412 Fizz Buzz - Easy
412. Fizz Buzz -- Easy
LeetCode 410 Split Array Largest Sum - Hard
410. Split Array Largest Sum -- Hard
LeetCode 41 First Missing Positive - Hard
41. First Missing Positive
LeetCode 409 Longest Palindrome - Easy
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those …
LeetCode 407 Trapping Rain Water II - Hard
407. Trapping Rain Water II -- Hard
LeetCode 406 Queue Reconstruction By Height - Medium
406. Queue Reconstruction by Height -- Medium
LeetCode 403 Frog Jump - Hard
403. Frog Jump -- Hard
LeetCode 402 Remove K Digits - Medium
402. Remove K Digits -- Medium
LeetCode 40 Combination Sum II - Medium
40. Combination Sum II
LeetCode 398 Evaluate Division - Medium
399. Evaluate Division -- Medium
LeetCode 395 Longest Substring With At Least K Repeating Characters - Medium
395. Longest Substring with At Least K Repeating Characters -- Medium
LeetCode 394 Decode String - Medium
394. Decode String -- Medium
LeetCode 390 Elimination Game - Medium
390. Elimination Game -- Medium
LeetCode 39 Combination Sum - Medium
39. Combination Sum
LeetCode 389 Find The Difference - Easy
389. Find the Difference -- Easy
LeetCode 387 First Unique Character In A String - Easy
387. First Unique Character in a String
LeetCode 386 Lexicographical Numbers - Medium
386. Lexicographical Numbers -- Medium
LeetCode 384 Shuffle An Array - Medium
384. Shuffle an Array -- Medium
LeetCode 383 Ransom Note - Easy
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return tru…
LeetCode 380 Insert Delete Get Random O(1) - Medium
380. Insert Delete GetRandom O(1)
LeetCode 38 Count And Say - Easy
38. Count and Say
LeetCode 378 Kth Smallest Element In A Sorted Matrix - Medium
378 Kth Smallest Element in a Sorted Matrix
LeetCode 377 Combination Sum IV - Medium
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive in…
LeetCode 37 Suudku Solver - Hard
37. Sudoku Solver
LeetCode 363 Max Sum Of Rectangle No Larger Than K - Hard
363. Max Sum of Rectangle No Larger Than K -- Hard
LeetCode 361 Bomb Enemy - Medium
LeetCode 36 Valid Sudoku - Medium
36. Valid Sudoku -- Medium
LeetCode 355 Design Twitter - Medium
355. Design Twitter
LeetCode 354 Russian Doll Envelopes - Hard
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only …
LeetCode 350 Intersection Of Two Arrays II - Easy
350. Intersection of Two Arrays II -- Easy
LeetCode 35 Search Insert Position - Easy
35. Search Insert Position
LeetCode 349 Intersection Of Two Arrays - Easy
349. Intersection of Two Arrays
LeetCode 347 Top K Frequent Elements - Medium
347. Top K Frequent Elements -- Medium
LeetCode 346 Moving Average From Data Stream - Easy
346. Moving Average from Data Stream
LeetCode 344 Reverse String - Easy
Write a function that reverses a string. The input string is given as an array of characters char[].
LeetCode 340 Longest Substring With At Most K Distinct Characters - Hard
340. Longest Substring with At Most K Distinct Characters
LeetCode 34 Find First And Last Position Of Element In Sorted Array - Medium
34. Find First and Last Position of Element in Sorted Array
LeetCode 338 Counting Bits - Medium
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary represe…
LeetCode 336 Palindrome Pairs - Hard
336. Palindrome Pairs
LeetCode 33 Search In Rotated Sorted Array - Medium
33. Search in Rotated Sorted Array
LeetCode 329 Longest Increasing Path In A Matrix - Hard
329. Longest Increasing Path in a Matrix -- Hard
LeetCode 325 Maximum Size Subarray Sum Equals K - Medium
325. Maximum Size Subarray Sum Equals k
LeetCode 323 Number Of Connected Components In An Undirected Graph - Medium
323. Number of Connected Components in an Undirected Graph -- Medium
LeetCode 322 Coin Change - Medium
LeetCode 320 Generalized Abbreviation - Medium
320. Generalized Abbreviation -- Medium
LeetCode 32 Longest Valid Parentheses - Hard
32. Longest Valid Parentheses -- Hard
LeetCode 317 Shortest Distance From All Buildings - Hard
317. Shortest Distance from All Buildings -- Hard
LeetCode 316 Remove Duplicate Letters - Medium
316. Remove Duplicate Letters -- Medium
LeetCode 314 Binary Tree Vertical Order Traversal - Medium
314. Binary Tree Vertical Order Traversal -- Medium
LeetCode 312 Burst Balloons - Hard
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst al…
LeetCode 31 Next Permutation - Medium
31. Next Permutation
LeetCode 305 Number Of Islands II - Hard
305. Number of Islands II -- Hard
LeetCode 302 Smallest Rectangle Enclosing Black Pixels - Hard
302. Smallest Rectangle Enclosing Black Pixels
LeetCode 301 Remove Invalid Parentheses - Hard
301. Remove Invalid Parentheses -- Hard
LeetCode 300 Longest Increasing Subsequence - Medium
Given an unsorted array of integers, find the length of longest increasing subsequence.
LeetCode 297 Serialize And Deserialize Binary Tree - Hard
297. Serialize and Deserialize Binary Tree
LeetCode 295 Find Median From Data Stream - Hard
295. Find Median from Data Stream -- Hard
LeetCode 292 Nim Game - Easy
292. Nim Game -- Easy
LeetCode 291 Word Pattern II - Hard
291. Word Pattern II
LeetCode 29 Divide Two Integers - Medium
29. Divide Two Integers
LeetCode 286 Walls And Gates - Medium
286. Walls and Gates -- Medium
LeetCode 283 Move Zeros - Easy
283. Move Zeroes
LeetCode 282 Expression Add Operators - Hard
282. Expression Add Operators -- Hard
LeetCode 28 Implementstr Str() - Easy
Implement strStr().
LeetCode 279 Perfect Squares - Medium
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.
LeetCode 278 First Bad Version - Easy
278. First Bad Version
LeetCode 273 Integer To Egnlish Words - Hard
273. Integer to English Words -- Hard
LeetCode 272 Closest Binary Search Tree Value II - Hard
272. Closest Binary Search Tree Value II
LeetCode 270 Closest Binary Search Tree Value - Easy
270. Closest Binary Search Tree Value
LeetCode 27 Remove Element - Easy
27. Remove Element
LeetCode 269 Alien Dictionary - Hard
269. Alien Dictionary
LeetCode 268 Missing Number - Easy
268. Missing Number
LeetCode 265 Paint House II - Hard
There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain color is …
LeetCode 264 Ugly Number II - Medium
264. Ugly Number II
LeetCode 26 Remove Duplicatesfrom Sorted Array - Easy
26. Remove Duplicates from Sorted Array
LeetCode 258 Add Digits - Easy
258. Add Digits -- Easy
LeetCode 257 B Inary Tree Paths - Easy
257. Binary Tree Paths
LeetCode 256 Paint House - Easy
There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house …
LeetCode 255 Verify Preorder Sequence In Binary Search Tree - Medium
255. Verify Preorder Sequence in Binary Search Tree -- Medium
LeetCode 253 Meeting Rooms II - Medium
253. Meeting Rooms II -- Medium
LeetCode 252 Meeting Rooms - Easy
252. Meeting Rooms -- Easy
LeetCode 25 Reverse Nodes In K-Group - Hard
25. Reverse Nodes in k-Group -- Hard
LeetCode 242 Valid Anagram - Easy
242. Valid Anagram
LeetCode 240 Search A2 D Matrix II - Medium
240. Search a 2D Matrix II
LeetCode 24 Swap Nodes In Pairs - Medium
24. Swap Nodes in Pairss
LeetCode 239 Sliding Window Maximum - Hard
239. Sliding Window Maximum
LeetCode 238 Product Of Array Except Self - Medium
238. Product of Array Except Self -- Medium
LeetCode 236 Lowest Common Ancestor Of A Binary Tree - Medium
236. Lowest Common Ancestor of a Binary Tree
LeetCode 235 Lowest Common Ancestor Of A Binary Search Tree - Easy
235. Lowest Common Ancestor of a Binary Search Tree -- Easy
LeetCode 234 Palindrome Linked List - Easy
234. Palindrome Linked List
LeetCode 232 Implement Queue Using Stacks - Easy
232. Implement Queue using Stacks
LeetCode 230 Kth Smallest Element Ina BST - Medium
230. Kth Smallest Element in a BST
LeetCode 23 Merge K Sorted Lists - Hard
23. Merge k Sorted Lists
LeetCode 229 Majority Element II - Medium
229. Majority Element II
LeetCode 227 Basic Calculator II - Medium
227. Basic Calculator II -- Medium
LeetCode 226 Invert Binary Tree - Easy
LeetCode 225 Implement Stack Using Queues - Easy
225. Implement Stack using Queues
LeetCode 222 Count Complete Tree Nodes - Medium
222. Count Complete Tree Nodes -- Medium
LeetCode 221 Maximal Square - Medium
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.
LeetCode 220 Contains Duplicate III - Medium
220. Contains Duplicate III -- Medium
LeetCode 22 Generate Parentheses - Medium
22. Generate Parentheses
LeetCode 219 Contains Duplicate II - Easy
219. Contains Duplicate II -- Easy
LeetCode 217 Contains Duplicate - Easy
217. Contains Duplicate -- Easy
LeetCode 215 Kth Largest Element In An Array - Medium
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct elem…
LeetCode 214 Shortest Palindrome - Hard
214. Shortest Palindrome
LeetCode 212 Wird Search II - Hard
212. Word Search II
LeetCode 210 Course Schedule II - Medium
210. Course Schedule II
LeetCode 21 Merge Two Sorted Lists - Easy
21. Merge Two Sorted Lists
LeetCode 209 Minimum Size Subarray Sum - Medium
209. Minimum Size Subarray Sum
LeetCode 207 Course Schedule - Medium
207. Course Schedule
LeetCode 206 Reverse Linked List - Easy
Reverse a singly linked list.
LeetCode 204 Count Primes - Easy
Count the number of prime numbers less than a non-negative number, n.
LeetCode 203 Remove Linked List Elements - Easy
203. Remove Linked List Elements
LeetCode 200 Number Of Islands - Medium
200. Number of Islands
LeetCode 20 Valid Parentheses - Easy
20. Valid Parentheses
LeetCode 198 House Robber - Easy
198. House Robber -- Easy
LeetCode 19 Remove Nth Node From End Of List - Medium
19. Remove Nth Node From End of List
LeetCode 189 Rotate Array - Medium
189. Rotate Array -- Medium
LeetCode 188 Best Time To Buy And Sell Stock IV - Hard
Say you have an array for which the i-th element is the price of a given stock on day i.
LeetCode 18 4 Sum - Medium
18. 4Sum
LeetCode 179 Largest Number - Medium
179. Largest Number -- Medium
LeetCode 173 Binary Search Tree Iterator - Medium
173. Binary Search Tree Iterator
LeetCode 170 Two Sum III-Data Structure Design - Easy
170. Two Sum III - Data structure design
LeetCode 17 Letter Combinations Of A Phone Number - Medium
17. Letter Combinations of a Phone Number
LeetCode 169 Majority Element - Easy
169. Majority Element
LeetCode 167 Two Sum II-Input Array Is Sorted - Easy
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
LeetCode 166 Fraction To Recurring Decimal - Medium
166. Fraction to Recurring Decimal -- Medium
LeetCode 162 Find Peak Element - Medium
162. Find Peak Element
LeetCode 1603 Design Parking System - Easy
1603. Design Parking System -- Easy
LeetCode 160 Intersection Of Two Linked Lists - Easy
160. Intersection of Two Linked Lists
LeetCode 16 3 Sum Closest - Medium
16. 3Sum Closest
LeetCode 1583 Count Unhappy Friends - Medium
1583. Count Unhappy Friends -- Medium
LeetCode 155 Min Stack - Easy
155. Min Stack
LeetCode 1528 Shuffle String - Easy
1528. Shuffle String -- Easy
LeetCode 1522 Diameter Of N-Ary Tree - Medium
1522. Diameter of N-Ary Tree -- Medium
LeetCode 152 Maximum Product Subarry - Medium
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.
LeetCode 151 Reverse Words In A String - Medium
151. Reverse Words in a String
LeetCode 15 3 Sum - Medium
15. 3Sum
LeetCode 1481 Least Number Of Unique Integers After K Removals - Medium
1481. Least Number of Unique Integers after K Removals -- Medium
LeetCode 1480 Running Sum Of1 D Array - Easy
1480. Running Sum of 1d Array -- Easy
LeetCode 1472 Design Browser History - Medium
1472. Design Browser History -- Medium
LeetCode 1470 Shuffle The Array - Easy
1470. Shuffle the Array -- Easy
LeetCode 1465 Maximum Area Of A Piece Of Cake After Horizontal And Vertical Cuts - Medium
1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts -- Medium
LeetCode 146 LRU Cache - Medium
146. LRU Cache
LeetCode 1458 Max Dot Product Of Two Subsequences - Hard
1458. Max Dot Product of Two Subsequences
LeetCode 1457 Pseudo-Palindromic Paths In A Binary Tree - Medium
1457. Pseudo-Palindromic Paths in a Binary Tree
LeetCode 1456 Maximum Number Of Vowels In A Substring Of Given Length - Medium
1456. Maximum Number of Vowels in a Substring of Given Length
LeetCode 1455 Check If A Word Occurs As A Prefix Of Any Word In A Sentence - Easy
1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence
LeetCode 145 Binary Tree Postorder Traversal - Hard
145. Binary Tree Postorder Traversal
LeetCode 144 Binary Tree Preorder Traversal - Medium
144. Binary Tree Preorder Traversal
LeetCode 1431 Kids With The Greatest Number Of Candies - Easy
1431. Kids With the Greatest Number of Candies -- Easy
LeetCode 143 Reorder List - Medium
143. Reorder List -- Medium
LeetCode 1429 First Unique Number - Medium
1429. First Unique Number -- Medium
LeetCode 1423 Maximum Points You Can Obtain From Cards - Medium
1423. Maximum Points You Can Obtain from Cards -- Medium
LeetCode 142 Linked List Cycle II - Medium
142. Linked List Cycle II
LeetCode 141 Linked List Cycle - Easy
141. Linked List Cycle
LeetCode 140 Word Break II - Hard
140. Word Break II -- Hard
LeetCode 14 Longest Common Prefix - Easy
14. Longest Common Prefix
LeetCode 1396 Design Underground System - Medium
1396. Design Underground System -- Medium
LeetCode 138 Copy List With Random Pointer - Medium
138. Copy List with Random Pointer -- Medium
LeetCode 1376 Time Needed To Inform All Employees - Medium
1376. Time Needed to Inform All Employees -- Medium
LeetCode 1375 Bulb Switcher III - Medium
1375. Bulb Switcher III -- Medium
LeetCode 1374 Generate A String With Characters That Have Odd Counts - Easy
1374. Generate a String With Characters That Have Odd Counts -- Easy
LeetCode 1366 Rank Teams By Votes - Medium
1366. Rank Teams by Votes -- Medium
LeetCode 1365 How Many Numbers Are Smaller Than The Current Number - Easy
1365. How Many Numbers Are Smaller Than the Current Number -- Easy
LeetCode 1361 Valid Binary Tree Nodes - Medium
1361. Validate Binary Tree Nodes (Pony.ai CHINA VO)
LeetCode 136 Single Number - Easy
136. Single Number -- Easy
LeetCode 1352 Product Of The Last K Numbers - Medium
1352. Product of the Last K Numbers -- Medium
LeetCode 1347 Minimum Number Of Steps To Make Two Strings Anagram - Medium
1347. Minimum Number of Steps to Make Two Strings Anagram -- Medium
LeetCode 134 Gas Station - Medium
LeetCode 1339 Maximum Product Of Splitted Binary Tree - Medium
1339. Maximum Product of Splitted Binary Tree -- Medium
LeetCode 1334 Find The City With The Smallest Number Of Neighbors At A Threshold Distance - Medium
1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance -- Medium
LeetCode 133 Clone Graph - Medium
133. Clone Graph
LeetCode 132 Palindrome Partitioning II - Hard
Given a string s, partition s such that every substring of the partition is a palindrome.
LeetCode 130 Surrounded Regions - Medium
130. Surrounded Regions -- Medium
LeetCode 13 Roman To Integer - Easy
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
LeetCode 1295 Find Numbers With Even Number Of Digits - Easy
Given an array nums of integers, return how many of them contain an even number of digits.
LeetCode 1290 Convert Binary Number In A Linked List To Integer - Easy
Binary to Decimal from Linked List:
LeetCode 1289 Minimum Falling Path Sum II - Hard
1289. Minimum Falling Path Sum II -- Hard
LeetCode 128 Longest Consecutive Sequence - Hard
128. Longest Consecutive Sequence -- Hard
LeetCode 1274 Number Of Ships In A Rectangle - Hard
1274. Number of Ships in a Rectangle -- Hard
LeetCode 127 Word Ladder - Medium
127. Word Ladder
LeetCode 1266 Minimum Time Visiting All Points - Easy
1266. Minimum Time Visiting All Points -- Easy
LeetCode 1262 Greatest Sum Divisible By Three - Medium
1262. Greatest Sum Divisible by Three -- Medium
LeetCode 126 Word Ladder II - Hard
126. Word Ladder II
LeetCode 1254 Number Of Closed Islands - Medium
1254. Number of Closed Islands -- Medium
LeetCode 125 Valid Palindrome - Easy
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
LeetCode 1249 Minimum Remove To Make Valid Parentheses - Medium
1249. Minimum Remove to Make Valid Parentheses -- Medium
LeetCode 1244 Design A Leaderboard - Medium
1244. Design A Leaderboard -- Medium
LeetCode 124 Binary Tree Maximum Path Sum - Hard
124. Binary Tree Maximum Path Sum -- Hard
LeetCode 1235 Maximum Profit In Job Scheduling - Hard
1235. Maximum Profit in Job Scheduling -- Hard
LeetCode 123 Best Time To Buy And Sell Stock III - Hard
Say you have an array for which the ith element is the price of a given stock on day i.
LeetCode 122 Best Time To Buy And Sell Stock II - Easy
Say you have an array prices for which the ith element is the price of a given stock on day i.
LeetCode 1216 Valid Palindrome III - Hard
1216. Valid Palindrome III
LeetCode 1214 Two Sum BS Ts - Medium
1214. Two Sum BSTs -- Medium
LeetCode 121 Best Time To Buy And Sell Stock - Easy
Say you have an array for which the ith element is the price of a given stock on day i.
LeetCode 1209 Remove All Adjacent Duplicates In String - Medium
1209. Remove All Adjacent Duplicates in String II -- Medium
LeetCode 1202 Smallest String With Swaps - Medium
1202. Smallest String With Swaps -- Medium
LeetCode 1200 Minimum Absolute Difference - Easy
1200. Minimum Absolute Difference -- Easy
LeetCode 12 Integer To Roman - Medium
12. Integer to Roman
LeetCode 1197 Minimum Knight Moves - Medium
1197. Minimum Knight Moves
LeetCode 1188 Design Bounded Blocking Queue - Medium
1188. Design Bounded Blocking Queue -- Medium
LeetCode 1172 Dinner Plate Stacks - Hard
1172. Dinner Plate Stacks -- Hard
LeetCode 117 Populating Next Right Pointers In Each Node II - Medium
117. Populating Next Right Pointers in Each Node II -- Medium
LeetCode 1169 Invalid Transactions - Medium
1169. Invalid Transactions -- Medium
LeetCode 1156 Swap For Longest Repeated Character Substring - Medium
1156. Swap For Longest Repeated Character Substring -- Medium
LeetCode 1153 String Transforms Into Another String - Hard
1153. String Transforms Into Another String -- Hard
LeetCode 115 Distinct Subsequnces - Hard
Given a string S and a string T, count the number of distinct subsequences of S which equals T.
LeetCode 1143 Longest Common Subsequence - Medium
Given two strings text1 and text2, return the length of their longest common subsequence.
LeetCode 114 Flatten Binary Tree To Linked List - Medium
114. Flatten Binary Tree to Linked List
LeetCode 1130 Minimum Cost Tree From Leaf Values - Medium
1130. Minimum Cost Tree From Leaf Values
LeetCode 112 Path Sum - Easy
112. Path Sum -- Easy
LeetCode 111 Minimum Depth Of Binary Tree - Easy
111. Minimum Depth of Binary Tree -- Easy
LeetCode 110 Balanced Binary Tree - Easy
110. Balanced Binary Tree
LeetCode 1099 Two Sum Less Than K - Easy
Given an array A of integers and integer K, return the maximum S such that there exists i < j with A[i] + A[j] = S and S < K. If no i, j …
LeetCode 1095 Find In Mountain Array - Hard
1095. Find in Mountain Array -- Hard
LeetCode 1092 Two City Scheduling - Medium
1029. Two City Scheduling -- Medium
LeetCode 1089 Duplicate Zeros - Easy
Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
LeetCode 1081 Smallest Subsequence Of Distinct Characters - Medium
1081. Smallest Subsequence of Distinct Characters -- Medium
LeetCode 1057 Campus Bikes - Medium
1057. Campus Bikes -- Medium
LeetCode 1054 Distant Barcodes - Medium
1054. Distant Barcodes -- Medium
LeetCode 1052 Grumpy Bookstore Owner - Medium
1052. Grumpy Bookstore Owner
LeetCode 1051 Height Checker - Easy
1051. Height Checker -- Easy
LeetCode 1049 Last Stone Weight II - Medium
1049. Last Stone Weight II -- Medium
LeetCode 104 Maximum Depth Of Binary Tree - Easy
104. Maximum Depth of Binary Tree
LeetCode 1031 Maximum Sum Of Two Non-Overlapping Subarrays - Medium
LeetCode 103 Binary Tree Zigzag Level Order Traversal - Medium
103. Binary Tree Zigzag Level Order Traversal
LeetCode 102 Binary Tree Level Order Traversal - Medium
102. Binary Tree Level Order Traversal
LeetCode 101 Symmetric Tree - Easy
101. Symmetric Tree -- Easy
LeetCode 1008 Construct Binary Search Tree From Preorder Traversal - Medium
1008. Construct Binary Search Tree from Preorder Traversal -- Medium
LeetCode 100 Same Tree - Easy
100. Same Tree -- Easy
LeetCode 10 Regular Expression Matching - Hard
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.
CyberLeet, a Three.js + React, cyberpunk style visualization for leetcode problems -- made for fun
Built with the native three.js and the create-react-app framework. Data was built with a python crawler.
Rabin-Karp Algorithm - A rolling hash method to locate substring
A very useful concept for string-searhing problem.
Discrete Events Simulation project for Tech Square Intersection Traffic with real world map visualization playback
A DES traffic simulation software package in python3, a visual playback web app in react.js using deck.gl trips layer
Use poisson distribution to generate random discrete events over a time for simulation
An example of how I use poisson distributed random variables to generate discrete events
COVID-19 Outbreaks Simulation and Analysis by an Extended SEIR Model focus on the hidden asymptomatic infections
Modeling COVID-19 with three outbreak-spread simulation methodologies - by continuum dynamical system (SIER system by differential equations), by a SEIR cellular automata model, by a Markov Chain Analysis Based on One Dimensional CA model.
Hood---Mate V1, a Geo-based Recommendation Sys with SNS feature
Geo-based SNS, Residense/roommates/landlords Recommendation System, Multi-dimensional exploratory data visualization