Checkpoint: arrays, pointers, and windows
Transfer: four problems you have not seen
Everything these need has been taught. Nothing has told you which idea to use.
Why this half exists
Solving a problem directly underneath a lesson about the pattern it uses proves very little. The lesson did the hardest part, which is deciding what kind of problem this is.
These four have no lesson above them. Every technique they need has been covered, and none of them is a NeetCode 150 problem, so you have not met any of them before.
Key idea
Your toolkit so far
Before you start, it is worth naming what you actually have. A set for membership. A count map for multiplicity. A canonical key for grouping. Bucketing by a bounded integer instead of sorting. A prefix array for range questions and for running values in either direction. Converging pointers on sorted or symmetric data. A discard argument to justify moving one side. A forward window with state, in maximizing and minimizing shapes.
Every one of the problems below is one or two of those. None needs anything else.
Tip
Use the method
Restate it. Do a small case by hand. Say the brute force and its cost. Find what the brute force recomputes. Check the edges. Only then write.
That procedure was the point of the last lesson in Unit 0, and this is the first place where nothing else will carry you.
Sorted Squares
Square every value in a sorted array and return the result in sorted order. Sorting afterward is O(n log n) and works; there is an O(n) answer, and the array being sorted by value is the clue to where the largest squares live.
Palindrome After One Deletion
Decide whether a string can be made a palindrome by deleting at most one character. Walk inward as usual, and think carefully about what your options are at the first mismatch.
Pivot Index
Find the index where the sum of everything to its left equals the sum of everything to its right. You have built exactly the two things this needs.
Longest Balanced Binary Subarray
Find the longest contiguous stretch holding equally many zeros and ones. This one needs two ideas from Unit 1 at the same time, and neither lesson showed them together. Work out what running quantity is equal at both ends of a balanced stretch.