Easy LeetCode Problems: All 760, With Python Solutions
Easy problems test whether you can turn a stated requirement into working code without fumbling the mechanics. The technique is usually named in the problem; the work is the edge cases.
The rating is LeetCode's own, carried through unchanged — we do not re-score anything. This library holds 760 Easy-rated problems, 588 of them with a complete Python solution, a worked example and complexity analysis.
The patterns behind easy problems
The six patterns with the most Easy-rated problems in this library. Working through a pattern beats working down a difficulty list, because the technique transfers and a difficulty band does not.
- Hash Map · 227 Easy problems — Trade memory for time: remember what you have seen so the second pass never happens.
- Math and Number Theory · 121 Easy problems — Find the closed form, the invariant, or the modular identity — and skip the loop entirely.
- Sorting · 80 Easy problems — Spend O(n log n) once to buy an ordering that makes the rest of the problem trivial.
- Two Pointers · 58 Easy problems — Use the order already in the input to discard half the search space at every step.
- Depth-First Search · 41 Easy problems — Follow one path to its end before trying the next — the default way to explore a graph.
- Greedy · 41 Easy problems — Take the locally best option every time — when you can prove that never costs you later.
Easy problems
Showing the first 200 of 760 problems. Problems with a complete Python solution are listed first, then by ascending problem number.
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 1 | Two Sum | Easy | Array, Hash Table |
| 9 | Palindrome Number | Easy | Math |
| 13 | Roman to Integer | Easy | Hash Table, Math, String |
| 14 | Longest Common Prefix | Easy | Trie, Array, String |
| 20 | Valid Parentheses | Easy | Stack, String |
| 21 | Merge Two Sorted Lists | Easy | Recursion, Linked List |
| 26 | Remove Duplicates from Sorted Array | Easy | Array, Two Pointers |
| 27 | Remove Element | Easy | Array, Two Pointers |
| 28 | Find the Index of the First Occurrence in a String | Easy | Two Pointers, String, String Matching |
| 35 | Search Insert Position | Easy | Array, Binary Search |
| 58 | Length of Last Word | Easy | String |
| 66 | Plus One | Easy | Array, Math |
| 67 | Add Binary | Easy | Bit Manipulation, Math, String +1 |
| 69 | Sqrt(x) | Easy | Math, Binary Search |
| 70 | Climbing Stairs | Easy | Memoization, Math, Dynamic Programming |
| 83 | Remove Duplicates from Sorted List | Easy | Linked List |
| 88 | Merge Sorted Array | Easy | Array, Two Pointers, Sorting |
| 94 | Binary Tree Inorder Traversal | Easy | Stack, Tree, Depth-First Search +1 |
| 100 | Same Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 101 | Symmetric Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 104 | Maximum Depth of Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 108 | Convert Sorted Array to Binary Search Tree | Easy | Tree, Binary Search Tree, Array +2 |
| 110 | Balanced Binary Tree | Easy | Tree, Depth-First Search, Binary Tree |
| 111 | Minimum Depth of Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 112 | Path Sum | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 118 | Pascal's Triangle | Easy | Array, Dynamic Programming |
| 119 | Pascal's Triangle II | Easy | Array, Dynamic Programming |
| 121 | Best Time to Buy and Sell Stock | Easy | Array, Dynamic Programming |
| 125 | Valid Palindrome | Easy | Two Pointers, String |
| 136 | Single Number | Easy | Bit Manipulation, Array |
| 141 | Linked List Cycle | Easy | Hash Table, Linked List, Two Pointers |
| 144 | Binary Tree Preorder Traversal | Easy | Stack, Tree, Depth-First Search +1 |
| 145 | Binary Tree Postorder Traversal | Easy | Stack, Tree, Depth-First Search +1 |
| 160 | Intersection of Two Linked Lists | Easy | Hash Table, Linked List, Two Pointers |
| 168 | Excel Sheet Column Title | Easy | Math, String |
| 169 | Majority Element | Easy | Array, Hash Table, Divide and Conquer +2 |
| 171 | Excel Sheet Column Number | Easy | Math, String |
| 175 | Combine Two Tables | Easy | Database |
| 181 | Employees Earning More Than Their Managers | Easy | Database |
| 182 | Duplicate Emails | Easy | Database |
| 183 | Customers Who Never Order | Easy | Database |
| 190 | Reverse Bits | Easy | Bit Manipulation, Divide and Conquer |
| 191 | Number of 1 Bits | Easy | Bit Manipulation, Divide and Conquer |
| 193 | Valid Phone Numbers | Easy | Shell |
| 195 | Tenth Line | Easy | Shell |
| 196 | Delete Duplicate Emails | Easy | Database |
| 197 | Rising Temperature | Easy | Database |
| 202 | Happy Number | Easy | Hash Table, Math, Two Pointers |
| 203 | Remove Linked List Elements | Easy | Recursion, Linked List |
| 205 | Isomorphic Strings | Easy | Hash Table, String |
| 206 | Reverse Linked List | Easy | Recursion, Linked List |
| 217 | Contains Duplicate | Easy | Array, Hash Table, Sorting |
| 219 | Contains Duplicate II | Easy | Array, Hash Table, Sliding Window |
| 222 | Count Complete Tree Nodes | Easy | Bit Manipulation, Tree, Binary Search +1 |
| 225 | Implement Stack using Queues | Easy | Stack, Design, Queue |
| 226 | Invert Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 228 | Summary Ranges | Easy | Array |
| 231 | Power of Two | Easy | Bit Manipulation, Recursion, Math |
| 232 | Implement Queue using Stacks | Easy | Stack, Design, Queue |
| 234 | Palindrome Linked List | Easy | Stack, Recursion, Linked List +1 |
| 242 | Valid Anagram | Easy | Hash Table, String, Sorting |
| 257 | Binary Tree Paths | Easy | Tree, Depth-First Search, String +2 |
| 258 | Add Digits | Easy | Math, Number Theory, Simulation |
| 263 | Ugly Number | Easy | Math |
| 268 | Missing Number | Easy | Bit Manipulation, Array, Hash Table +3 |
| 278 | First Bad Version | Easy | Binary Search, Interactive |
| 283 | Move Zeroes | Easy | Array, Two Pointers |
| 290 | Word Pattern | Easy | Hash Table, String |
| 292 | Nim Game | Easy | Brainteaser, Math, Game Theory |
| 303 | Range Sum Query - Immutable | Easy | Design, Array, Prefix Sum |
| 326 | Power of Three | Easy | Recursion, Math |
| 338 | Counting Bits | Easy | Bit Manipulation, Dynamic Programming |
| 342 | Power of Four | Easy | Bit Manipulation, Recursion, Math |
| 344 | Reverse String | Easy | Two Pointers, String |
| 345 | Reverse Vowels of a String | Easy | Two Pointers, String |
| 349 | Intersection of Two Arrays | Easy | Array, Hash Table, Two Pointers +2 |
| 350 | Intersection of Two Arrays II | Easy | Array, Hash Table, Two Pointers +2 |
| 367 | Valid Perfect Square | Easy | Math, Binary Search |
| 374 | Guess Number Higher or Lower | Easy | Binary Search, Interactive |
| 383 | Ransom Note | Easy | Hash Table, String, Counting |
| 387 | First Unique Character in a String | Easy | Queue, Hash Table, String +1 |
| 389 | Find the Difference | Easy | Bit Manipulation, Hash Table, String +1 |
| 392 | Is Subsequence | Easy | Two Pointers, String, Dynamic Programming |
| 401 | Binary Watch | Easy | Bit Manipulation, Backtracking |
| 404 | Sum of Left Leaves | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 405 | Convert a Number to Hexadecimal | Easy | Bit Manipulation, Math, String |
| 409 | Longest Palindrome | Easy | Greedy, Hash Table, String |
| 412 | Fizz Buzz | Easy | Math, String, Simulation |
| 414 | Third Maximum Number | Easy | Array, Sorting |
| 415 | Add Strings | Easy | Math, String, Simulation |
| 434 | Number of Segments in a String | Easy | String |
| 441 | Arranging Coins | Easy | Math, Binary Search |
| 448 | Find All Numbers Disappeared in an Array | Easy | Array, Hash Table |
| 455 | Assign Cookies | Easy | Greedy, Array, Two Pointers +1 |
| 459 | Repeated Substring Pattern | Easy | String, String Matching |
| 461 | Hamming Distance | Easy | Bit Manipulation |
| 463 | Island Perimeter | Easy | Depth-First Search, Breadth-First Search, Array +1 |
| 476 | Number Complement | Easy | Bit Manipulation |
| 482 | License Key Formatting | Easy | String |
| 485 | Max Consecutive Ones | Easy | Array |
| 492 | Construct the Rectangle | Easy | Math |
| 495 | Teemo Attacking | Easy | Array, Simulation |
| 496 | Next Greater Element I | Easy | Stack, Array, Hash Table +1 |
| 500 | Keyboard Row | Easy | Array, Hash Table, String |
| 501 | Find Mode in Binary Search Tree | Easy | Tree, Depth-First Search, Binary Search Tree +1 |
| 504 | Base 7 | Easy | Math, String |
| 506 | Relative Ranks | Easy | Array, Sorting, Heap (Priority Queue) |
| 507 | Perfect Number | Easy | Math |
| 509 | Fibonacci Number | Easy | Recursion, Memoization, Math +1 |
| 511 | Game Play Analysis I | Easy | Database |
| 520 | Detect Capital | Easy | String |
| 521 | Longest Uncommon Subsequence I | Easy | String |
| 530 | Minimum Absolute Difference in BST | Easy | Tree, Depth-First Search, Breadth-First Search +2 |
| 541 | Reverse String II | Easy | Two Pointers, String |
| 543 | Diameter of Binary Tree | Easy | Tree, Depth-First Search, Binary Tree |
| 551 | Student Attendance Record I | Easy | String |
| 557 | Reverse Words in a String III | Easy | Two Pointers, String |
| 559 | Maximum Depth of N-ary Tree | Easy | Tree, Depth-First Search, Breadth-First Search |
| 561 | Array Partition | Easy | Greedy, Array, Counting Sort +1 |
| 563 | Binary Tree Tilt | Easy | Tree, Depth-First Search, Binary Tree |
| 566 | Reshape the Matrix | Easy | Array, Matrix, Simulation |
| 572 | Subtree of Another Tree | Easy | Tree, Depth-First Search, Binary Tree +2 |
| 575 | Distribute Candies | Easy | Array, Hash Table |
| 577 | Employee Bonus | Easy | Database |
| 584 | Find Customer Referee | Easy | Database |
| 586 | Customer Placing the Largest Number of Orders | Easy | Database |
| 589 | N-ary Tree Preorder Traversal | Easy | Stack, Tree, Depth-First Search |
| 590 | N-ary Tree Postorder Traversal | Easy | Stack, Tree, Depth-First Search |
| 594 | Longest Harmonious Subsequence | Easy | Array, Hash Table, Counting +2 |
| 595 | Big Countries | Easy | Database |
| 596 | Classes With at Least 5 Students | Easy | Database |
| 598 | Range Addition II | Easy | Array, Math |
| 599 | Minimum Index Sum of Two Lists | Easy | Array, Hash Table, String |
| 605 | Can Place Flowers | Easy | Greedy, Array |
| 607 | Sales Person | Easy | Database |
| 610 | Triangle Judgement | Easy | Database |
| 617 | Merge Two Binary Trees | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 619 | Biggest Single Number | Easy | Database |
| 620 | Not Boring Movies | Easy | Database |
| 627 | Swap Sex of Employees | Easy | Database |
| 628 | Maximum Product of Three Numbers | Easy | Array, Math, Sorting |
| 637 | Average of Levels in Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 643 | Maximum Average Subarray I | Easy | Array, Sliding Window |
| 645 | Set Mismatch | Easy | Bit Manipulation, Array, Hash Table +1 |
| 653 | Two Sum IV - Input is a BST | Easy | Tree, Depth-First Search, Breadth-First Search +4 |
| 657 | Robot Return to Origin | Easy | String, Simulation |
| 661 | Image Smoother | Easy | Array, Matrix |
| 671 | Second Minimum Node In a Binary Tree | Easy | Tree, Depth-First Search, Binary Tree |
| 674 | Longest Continuous Increasing Subsequence | Easy | Array |
| 680 | Valid Palindrome II | Easy | Greedy, Two Pointers, String |
| 682 | Baseball Game | Easy | Stack, Array, Simulation |
| 693 | Binary Number with Alternating Bits | Easy | Bit Manipulation |
| 696 | Count Binary Substrings | Easy | Two Pointers, String |
| 697 | Degree of an Array | Easy | Array, Hash Table |
| 700 | Search in a Binary Search Tree | Easy | Tree, Binary Search Tree, Binary Tree |
| 703 | Kth Largest Element in a Stream | Easy | Tree, Design, Binary Search Tree +3 |
| 704 | Binary Search | Easy | Array, Binary Search |
| 705 | Design HashSet | Easy | Design, Array, Hash Table +2 |
| 706 | Design HashMap | Easy | Design, Array, Hash Table +2 |
| 709 | To Lower Case | Easy | String |
| 717 | 1-bit and 2-bit Characters | Easy | Array |
| 724 | Find Pivot Index | Easy | Array, Prefix Sum |
| 728 | Self Dividing Numbers | Easy | Math |
| 733 | Flood Fill | Easy | Depth-First Search, Breadth-First Search, Array +1 |
| 744 | Find Smallest Letter Greater Than Target | Easy | Array, Binary Search |
| 746 | Min Cost Climbing Stairs | Easy | Array, Dynamic Programming |
| 747 | Largest Number At Least Twice of Others | Easy | Array, Sorting |
| 748 | Shortest Completing Word | Easy | Array, Hash Table, String |
| 762 | Prime Number of Set Bits in Binary Representation | Easy | Bit Manipulation, Math |
| 766 | Toeplitz Matrix | Easy | Array, Matrix |
| 771 | Jewels and Stones | Easy | Hash Table, String |
| 783 | Minimum Distance Between BST Nodes | Easy | Tree, Depth-First Search, Breadth-First Search +2 |
| 796 | Rotate String | Easy | String, String Matching |
| 804 | Unique Morse Code Words | Easy | Array, Hash Table, String |
| 806 | Number of Lines To Write String | Easy | Array, String |
| 812 | Largest Triangle Area | Easy | Geometry, Array, Math |
| 819 | Most Common Word | Easy | Array, Hash Table, String +1 |
| 821 | Shortest Distance to a Character | Easy | Array, Two Pointers, String |
| 824 | Goat Latin | Easy | String |
| 830 | Positions of Large Groups | Easy | String |
| 832 | Flipping an Image | Easy | Bit Manipulation, Array, Two Pointers +2 |
| 836 | Rectangle Overlap | Easy | Geometry, Math |
| 844 | Backspace String Compare | Easy | Stack, Two Pointers, String +1 |
| 859 | Buddy Strings | Easy | Hash Table, String |
| 860 | Lemonade Change | Easy | Greedy, Array |
| 867 | Transpose Matrix | Easy | Array, Matrix, Simulation |
| 868 | Binary Gap | Easy | Bit Manipulation |
| 872 | Leaf-Similar Trees | Easy | Tree, Depth-First Search, Binary Tree |
| 876 | Middle of the Linked List | Easy | Linked List, Two Pointers |
| 883 | Projection Area of 3D Shapes | Easy | Geometry, Array, Math +1 |
| 884 | Uncommon Words from Two Sentences | Easy | Hash Table, String, Counting |
| 888 | Fair Candy Swap | Easy | Array, Hash Table, Binary Search +1 |
| 892 | Surface Area of 3D Shapes | Easy | Geometry, Array, Math +1 |
| 896 | Monotonic Array | Easy | Array |
| 897 | Increasing Order Search Tree | Easy | Stack, Tree, Depth-First Search +2 |
| 905 | Sort Array By Parity | Easy | Array, Two Pointers, Sorting |
| 908 | Smallest Range I | Easy | Array, Math |
| 914 | X of a Kind in a Deck of Cards | Easy | Array, Hash Table, Math +2 |
| 917 | Reverse Only Letters | Easy | Two Pointers, String |
| 922 | Sort Array By Parity II | Easy | Array, Two Pointers, Sorting |
Keep exploring
Everything at once: the full LeetCode problem list.
A easy problem, live, with someone watching
Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.