Checkpoint: arrays, pointers, and windows
29 / 170Checkpoint: arrays, pointers, and windowsLesson 2 of 3About 91 min
Everything these need has been taught. Nothing has told you which idea to use.
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.
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.
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.
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.
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.