J.P. Morgan LeetCode Questions
79 questions all-time · 27 easy · 47 medium · 5 hard
| # | Problem | Difficulty | Frequency | Acceptance |
|---|---|---|---|---|
| 1 | Sort Integers by The Number of 1 Bits Array, Bit Manipulation, Sorting, Counting | Easy | 100 | 78.7% |
| 2 | Reaching Points Math | Hard | 97 | 33.6% |
| 3 | Least Number of Unique Integers after K Removals Array, Hash Table, Greedy, Sorting, Counting | Medium | 93 | 63.4% |
| 4 | Minimum Suffix Flips String, Greedy | Medium | 91 | 73.5% |
| 5 | Remove Colored Pieces if Both Neighbors are the Same Color Math, String, Greedy, Game Theory | Medium | 89 | 62.8% |
| 6 | Break a Palindrome String, Greedy | Medium | 86 | 51.5% |
| 7 | Minimum Absolute Difference Array, Sorting | Easy | 83 | 70.7% |
| 8 | Next Permutation Array, Two Pointers | Medium | 83 | 43.1% |
| 9 | Check Whether Two Strings are Almost Equivalent Hash Table, String, Counting | Easy | 83 | 63.6% |
| 10 | Group Anagrams Array, Hash Table, String, Sorting | Medium | 78 | 70.9% |
| 11 | Best Time to Buy and Sell Stock Array, Dynamic Programming | Easy | 76 | 55.3% |
| 12 | Determine Color of a Chessboard Square Math, String | Easy | 74 | 79.3% |
| 13 | Minimum Swaps to Make Strings Equal Math, String, Greedy | Medium | 74 | 64.7% |
| 14 | Numbers With Repeated Digits Math, Dynamic Programming | Hard | 74 | 43.5% |
| 15 | Merge Intervals Array, Sorting | Medium | 72 | 49.4% |
| 16 | Suspicious Bank Accounts Database | Medium | 70 | 44.9% |
| 17 | Button with Longest Push Time Array | Easy | 70 | 40.6% |
| 18 | Display Table of Food Orders in a Restaurant Array, Hash Table, String, Sorting, Ordered Set | Medium | 70 | 75.7% |
| 19 | Check if Number Has Equal Digit Count and Digit Value Hash Table, String, Counting | Easy | 70 | 72.4% |
| 20 | Maximum Number of Points From Grid Queries Array, Two Pointers, Breadth-First Search, Union Find, Sorting, Heap (Priority Queue), Matrix | Hard | 70 | 59.5% |
| 21 | Valid Parentheses String, Stack | Easy | 70 | 42.3% |
| 22 | Lexicographically Smallest String After Applying Operations String, Depth-First Search, Breadth-First Search, Enumeration | Medium | 70 | 65.3% |
| 23 | Rotate Image Array, Math, Matrix | Medium | 70 | 77.9% |
| 24 | Lexicographically Smallest String After a Swap String, Greedy | Easy | 70 | 53.7% |
| 25 | Reverse Odd Levels of Binary Tree Tree, Depth-First Search, Breadth-First Search, Binary Tree | Medium | 70 | 86.6% |
| 26 | Find Resultant Array After Removing Anagrams Array, Hash Table, String, Sorting | Easy | 68 | 59.5% |
| 27 | Longest Palindromic Substring Two Pointers, String, Dynamic Programming | Medium | 66 | 35.8% |
| 28 | Count Numbers with Unique Digits Math, Dynamic Programming, Backtracking | Medium | 63 | 54.3% |
| 29 | Happy Number Hash Table, Math, Two Pointers | Easy | 60 | 58.1% |
| 30 | Longest Substring Without Repeating Characters Hash Table, String, Sliding Window | Medium | 60 | 36.9% |
| 31 | Climbing Stairs Math, Dynamic Programming, Memoization | Easy | 56 | 53.5% |
| 32 | Maximum Product of Two Elements in an Array Array, Sorting, Heap (Priority Queue) | Easy | 56 | 83.2% |
| 33 | Minimum Operations to Make All Array Elements Equal Array, Binary Search, Sorting, Prefix Sum | Medium | 51 | 36.9% |
| 34 | Subarray Sum Equals K Array, Hash Table, Prefix Sum | Medium | 51 | 45.5% |
| 35 | Maximum Units on a Truck Array, Greedy, Sorting | Easy | 51 | 74.3% |
| 36 | Two Sum Array, Hash Table | Easy | 51 | 55.8% |
| 37 | Fizz Buzz Math, String, Simulation | Easy | 51 | 74.4% |
| 38 | Intersection of Two Arrays Array, Hash Table, Two Pointers, Binary Search, Sorting | Easy | 51 | 76.5% |
| 39 | Generate Parentheses String, Dynamic Programming, Backtracking | Medium | 51 | 77.1% |
| 40 | Maximum Subarray Array, Divide and Conquer, Dynamic Programming | Medium | 51 | 52.1% |
| 41 | Best Time to Buy and Sell Stock II Array, Dynamic Programming, Greedy | Medium | 51 | 69.5% |
| 42 | Rearrange Array to Maximize Prefix Score Array, Greedy, Sorting, Prefix Sum | Medium | 51 | 41.5% |
| 43 | Coin Change Array, Dynamic Programming, Breadth-First Search | Medium | 45 | 46.5% |
| 44 | Non-overlapping Intervals Array, Dynamic Programming, Greedy, Sorting | Medium | 45 | 55.5% |
| 45 | Fibonacci Number Math, Dynamic Programming, Recursion, Memoization | Easy | 45 | 72.9% |
| 46 | Minimum Cost to Connect Sticks Array, Greedy, Heap (Priority Queue) | Medium | 45 | 71.2% |
| 47 | Pascal's Triangle Array, Dynamic Programming | Easy | 45 | 77.0% |
| 48 | Minimum Cost to Make Array Equal Array, Binary Search, Greedy, Sorting, Prefix Sum | Hard | 45 | 46.3% |
| 49 | LRU Cache Hash Table, Linked List, Design, Doubly-Linked List | Medium | 45 | 45.2% |
| 50 | Daily Temperatures Array, Stack, Monotonic Stack | Medium | 45 | 67.4% |
| 51 | Binary Tree Right Side View Tree, Depth-First Search, Breadth-First Search, Binary Tree | Medium | 45 | 67.0% |
| 52 | Reverse Linked List Linked List, Recursion | Easy | 45 | 79.2% |
| 53 | Two Sum II - Input Array Is Sorted Array, Two Pointers, Binary Search | Medium | 36 | 63.4% |
| 54 | Set Matrix Zeroes Array, Hash Table, Matrix | Medium | 36 | 60.7% |
| 55 | Find Occurrences of an Element in an Array Array, Hash Table | Medium | 36 | 72.6% |
| 56 | Letter Combinations of a Phone Number Hash Table, String, Backtracking | Medium | 36 | 63.9% |
| 57 | Palindrome Number Math | Easy | 36 | 59.2% |
| 58 | Kth Largest Element in an Array Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect | Medium | 36 | 68.0% |
| 59 | Top K Frequent Elements Array, Hash Table, Divide and Conquer, Sorting, Heap (Priority Queue), Bucket Sort, Counting, Quickselect | Medium | 36 | 64.6% |
| 60 | Average Time of Process per Machine Database | Easy | 36 | 68.6% |
| 61 | Container With Most Water Array, Two Pointers, Greedy | Medium | 36 | 57.8% |
| 62 | Permutations Array, Backtracking | Medium | 36 | 80.7% |
| 63 | Shuffle an Array Array, Math, Design, Randomized | Medium | 36 | 59.0% |
| 64 | Count Binary Substrings Two Pointers, String | Easy | 36 | 65.9% |
| 65 | Count Strictly Increasing Subarrays Array, Math, Dynamic Programming | Medium | 36 | 71.3% |
| 66 | Open the Lock Array, Hash Table, String, Breadth-First Search | Medium | 36 | 60.7% |
| 67 | Minimum String Length After Removing Substrings String, Stack, Simulation | Easy | 36 | 77.1% |
| 68 | Cherry Pickup Array, Dynamic Programming, Matrix | Hard | 36 | 37.9% |
| 69 | Degree of an Array Array, Hash Table | Easy | 36 | 57.4% |
| 70 | Minimum Insertions to Balance a Parentheses String String, Stack, Greedy | Medium | 36 | 53.2% |
| 71 | Search Suggestions System Array, String, Binary Search, Trie, Sorting, Heap (Priority Queue) | Medium | 36 | 65.1% |
| 72 | Find the Duplicate Number Array, Two Pointers, Binary Search, Bit Manipulation | Medium | 36 | 62.8% |
| 73 | Ugly Number Math | Easy | 36 | 42.3% |
| 74 | Contains Duplicate Array, Hash Table, Sorting | Easy | 36 | 63.2% |
| 75 | Sum of Subarray Ranges Array, Stack, Monotonic Stack | Medium | 36 | 60.1% |
| 76 | Decode Ways String, Dynamic Programming | Medium | 36 | 36.5% |
| 77 | Combination Sum Array, Backtracking | Medium | 36 | 74.7% |
| 78 | Integer to Roman Hash Table, Math, String | Medium | 36 | 68.6% |
| 79 | Spiral Matrix Array, Matrix, Simulation | Medium | 36 | 53.9% |
How to read this list
The tabs at the top split the questions by how recently people said they were asked in interviews. "Last 30 Days" is the past month, "Last 3 Months" is the past quarter, and so on. "All Time" is every question on record for this company.
Frequency is a score from 0 to 100 for how often a question showed up in that time window. A higher number means it came up more often, so the list starts with the most common questions first. Acceptance is the share of submissions that pass on LeetCode. Click any question to open it on LeetCode.