Which earlier position can pair with this one?
Target 9, input [2,5,7]. Just before reading 7, draw the map if it stores a position for each earlier value.
1 / 6
Target 9, input [2,5,7]. Just before reading 7, draw the map if it stores a position for each earlier value.
Trace [4,1] and [4,4] with target 8. Decide whether to look up the complement before or after recording the current position.
Compare "abb" and "aab". Count the first word, then spend its letters to construct the second. Where does payment first fail?
Read one character from each word at a time, adding for "bc" and subtracting for "cb". Predict both balances after each step.
In "teeter", the final counts are t → 2, e → 3, r → 1. What does the function return? Change the input to "teerk" and choose between the singletons.
For three 6s and target 12, one caller needs a pair of positions. Another needs the number of pairs. What must a map entry tell each caller?