LeetCode 75 is LeetCode's own free 75-problem study plan, and in Java it is a compact tour of the collections framework: StringBuilder as a stack, ArrayDeque as a queue, TreeSet as a sorted pool and PriorityQueue for four heap problems. It also contains more problems than you would expect where an int silently overflows. This page shows which Java APIs the plan uses, gives group-by-group notes, lists every LeetCode 75 problem where int is not enough, and ends with a five-week schedule. For the plan itself, see our LeetCode 75 guide; for how it compares with the classic list, LeetCode 75 vs Blind 75.
The Java APIs the plan uses
The plan has 75 problems in 22 groups, 22 easy and 53 medium, with no hard problems and none behind Premium. Counts were read from each list's own site data on November 12, 2026. Lists are edited from time to time, so numbers can drift.
| API | Where you use it |
|---|---|
StringBuilder | Merge Strings Alternately, Reverse Words in a String, Removing Stars From a String (as a stack), Decode String |
char[] | Reverse Vowels of a String, String Compression (in place), Is Subsequence |
int[26] counts | Maximum Number of Vowels in a Substring, Determine if Two Strings Are Close |
HashMap and HashSet | the Hash Map / Set group, Max Number of K-Sum Pairs, Path Sum III, Evaluate Division |
ArrayDeque | Number of Recent Calls, Dota2 Senate, Decode String, every BFS, Online Stock Span |
PriorityQueue | Kth Largest Element, Maximum Subsequence Score, Total Cost to Hire K Workers |
TreeSet | Smallest Number in Infinite Set |
Arrays.sort and binary search | Successful Pairs of Spells and Potions, Search Suggestions System, both interval problems |
Integer.bitCount | Minimum Flips to Make a OR b Equal to c |
Group by group in Java
- Array / String (9): Java's
Mathhas no int gcd, so Greatest Common Divisor of Strings needs a two-line Euclid loop. Reverse Words in a String iss.trim().split("\\s+"), reversed and joined withString.join(" ", ...); a plainsplit(" ")leaves empty strings between repeated spaces. Kids With the Greatest Number of Candies returns aList<Boolean>. String Compression writes digits withInteger.toString(count).toCharArray()into the same array. - Two Pointers (4) and Sliding Window (4): Move Zeroes keeps a write index. Max Number of K-Sum Pairs can sort and walk two pointers, which avoids boxing every number into a HashMap. Maximum Number of Vowels tests
"aeiou".indexOf(c) >= 0. - Hash Map / Set (4): Find the Difference of Two Arrays builds two
HashSet<Integer>, callsremoveAllon copies and wraps each innew ArrayList<>(...). Unique Number of Occurrences isnew HashSet<>(counts.values()).size() == counts.size(). In Equal Row and Column Pairs, anint[]used as a HashMap key hashes by identity, so two equal rows never match; key each row withArrays.toString(row)or aList<Integer>. - Stack (3) and Queue (2): Removing Stars uses a StringBuilder as the stack with
deleteCharAt(sb.length() - 1). Asteroid Collision is fastest with anint[]stack and a top index. Decode String keeps oneArrayDeque<Integer>of counts and oneArrayDeque<StringBuilder>. Number of Recent Calls polls whilepeekFirst() < t - 3000. - Linked List (4): Delete the Middle Node starts the fast pointer two nodes ahead so the slow one stops before the middle. Maximum Twin Sum reverses the second half in place instead of copying into a list.
- Trees (10): Count Good Nodes passes the maximum so far down the recursion. Binary Tree Right Side View records the last node of each level using a
queue.size()snapshot. Delete Node in a BST replaces a node with two children by its inorder successor. - Graphs (6): Keys and Rooms and Number of Provinces need only a
boolean[] visited. Reorder Routes storesint[]pairs of {neighbour, cost} in aList<List<int[]>>. Evaluate Division usesMap<String, Map<String, Double>>. Nearest Exit and Rotting Oranges queueint[]cells in anArrayDeque. - Heap (4): Smallest Number in Infinite Set is neat with a
TreeSet<Integer>of added-back numbers plus a counter for the next unused one;pollFirst()returns the smallest. Maximum Subsequence Score sortsint[][]pairs by nums2 descending and keeps a size-k min-heap of nums1. - Backtracking (2) and DP (8): Letter Combinations reuses one StringBuilder with
setLength. Combination Sum III undoes choices withpath.remove(path.size() - 1). Longest Common Subsequence and Edit Distance useint[][]tables that can shrink to two rows. - Trie (2): Search Suggestions System can sort the products and binary search for the first word at or after each prefix, or keep up to three words in each trie node.
Every LeetCode 75 problem where int is not enough
These limits come from each problem's constraints on LeetCode, read on November 12, 2026.
| Problem | Why int fails | Fix |
|---|---|---|
| Path Sum III | Node values go up to 10 to the power 9 in size, so running path sums overflow | long sums in a HashMap<Long, Integer> |
| Successful Pairs of Spells and Potions | spell times potion reaches 10 to the power 10; success is a long in the Java signature | (long) spell * potions[mid] >= success |
| Koko Eating Bananas | 10,000 piles of up to 10 to the power 9 bananas make the hour count overflow at low speeds | count hours in a long |
| Maximum Subsequence Score | the sum of k values times a multiplier reaches about 10 to the power 15 | long sum; the method returns long |
| Total Cost to Hire K Workers | up to 100,000 hires at up to 100,000 each | long total; the method returns long |
| Guess Number Higher or Lower | n can be 2 to the power 31 minus 1, so lo plus hi overflows | lo + (hi - lo) / 2 |
| Minimum Number of Arrows to Burst Balloons | coordinates span the full int range, so a[1] - b[1] overflows and sorts wrongly | Integer.compare(a[1], b[1]) |
| Domino and Tromino Tiling | intermediate values before the modulo can pass 2 to the power 31 | long arithmetic, then % 1_000_000_007 |
| Maximum Average Subarray I | not overflow: best / k is integer division and drops the fraction | (double) best / k |
Problems worth repeating in Java
| Problem | What it trains in Java |
|---|---|
| Equal Row and Column Pairs | Choosing a key type that hashes by value |
| Decode String | Two stacks of different types moving in step |
| Smallest Number in Infinite Set | Designing with TreeSet instead of a heap plus a set |
| Evaluate Division | Nested maps and a weighted DFS |
| Total Cost to Hire K Workers | Two heaps fed by two pointers, with long totals |
| Asteroid Collision | Stack simulation on a primitive array |
| Search Suggestions System | Sorting plus binary search as an alternative to a trie |
After LeetCode 75, the classic list in the same language is Blind 75 in Java; only ten problems repeat.
A five-week schedule
| Week | Groups | Problems |
|---|---|---|
| 1 | Array / String, Two Pointers, Sliding Window, Prefix Sum | 19 |
| 2 | Hash Map / Set, Stack, Queue, Linked List, Monotonic Stack | 15 |
| 3 | Binary Tree DFS and BFS, Binary Search Tree, Trie | 12 |
| 4 | Graphs DFS and BFS, Heap, Binary Search, Intervals | 16 |
| 5 | Backtracking, DP 1D and Multidimensional, Bit Manipulation | 13 |
This order groups the problems by the Java structure they need, so each week drills one part of the collections framework. Add a sixth week to redo failed problems if you have it. LeetCode runs Java on OpenJDK 25 and includes a Pair class, as LeetCode's help page on language environments listed it on November 12, 2026.
Turning a list into interview skill
Any list only helps if the practice transfers to problems you have not seen. These habits make the difference:
- Time-box every attempt: about 25 minutes for a medium before you read a solution.
- Keep a log with one line per problem: the pattern, the key idea and the complexity.
- Redo failed problems after three days, a week and three weeks, without looking at your old code.
- Explain your approach out loud before and while you code, as you would to an interviewer.
- In the last two weeks, switch to unseen problems without topic labels.
The patterns most lists are built on are explained in array and string patterns and tree, graph and recursion patterns.
Where CoPilot Interview fits
Finishing a list is not the same as passing an interview: interviewers score how you explain your approach, your trade-offs and your complexity out loud. CoPilot Interview is an AI interview assistant; its free AI mock interview asks coding questions, listens to your spoken explanation and scores it out of ten with a model answer, which is the part a problem list cannot train. The free plan gives 15 minutes a day of live help in sessions of up to 15 minutes, with AI mock interviews included. Online assessments and live coding rounds usually forbid outside help, so practice now and follow your employer's rules on the day.
Disclosure: CoPilot Interview is our product, so weigh what we say about it accordingly.
Frequently asked questions
Is LeetCode 75 good practice for Java?
Yes. It touches StringBuilder, ArrayDeque, HashMap, TreeSet and PriorityQueue, and it has no hard problems, so the language rather than the algorithm is often the main challenge.
Which LeetCode 75 problems need long in Java?
Path Sum III, Successful Pairs of Spells and Potions, Koko Eating Bananas, Maximum Subsequence Score and Total Cost to Hire K Workers. Minimum Number of Arrows also needs Integer.compare instead of subtraction.
Which Java version does LeetCode use?
OpenJDK 25, with a Pair class included, as LeetCode's help page listed it in November 2026.
Does LeetCode 75 need Premium?
No. All 75 problems were free in LeetCode's study-plan data on November 12, 2026.
Practice this interview before the real one
The AI mock interview builds questions from your resume and the job description, reads them aloud and scores each spoken answer out of 10. Included on the free plan.
Start a mock interview