Spot the correct code.
Three implementations. One of them is right.
The wrong two are the correct code with between two and five lines changed — a pop_back at the bottom of a recursion that never runs, a bound that moves by one, a reference that will not bind. Difficulty is the closest decoy: two changed lines is Hard, because an option wrong in only two places is the one that survives a careless read.
The problem is named here, unlike the other mode — the statement is on the page anyway, so there is nothing left for a name to give away.
ProblemDifficulty
- Climbing StairsHardHard
- Contains DuplicateHardHard
- Best Time to Buy and Sell StockHardHard
- Two SumHardHard
- Valid ParenthesesHardHard
- Valid AnagramHardHard
- Container With Most WaterHardHard
- Product of Array Except SelfHardHard
- Longest Substring Without Repeating CharactersHardHard
- Maximum SubarrayHardHard
- Letter Combinations of a Phone NumberHardHard
- PermutationsHardHard
- Find Median from Data StreamHardHard
- Multiply StringsHardHard
- Jump GameHardHard
- N-QueensHardHard
- Palindrome PartitioningHardHard
- Count Good Nodes in Binary TreeHardHard
- Serialize and Deserialize Binary TreeHardHard
- Kth Largest Element in a StreamHardHard
- Maximum Product SubarrayHardHard
- Binary SearchHardHard
- Longest Common SubsequenceHardHard
- Cheapest Flights Within K StopsHardHard
- Kth Smallest Element in a BSTHardHard
- Merge IntervalsHardHard
- Valid SudokuHardHard
- Target SumHardHard
- Construct Binary Tree from Preorder and Inorder TraversalHardHard
- Binary Tree Maximum Path SumHardHard
- Search in Rotated Sorted ArrayHardHard
- Non-overlapping IntervalsHardHard
- Linked List CycleHardHard
- Counting BitsHardHard
- Alien DictionaryHardHard
- Encode and Decode StringsHardHard
- Jump Game IIHardHard
- K Closest Points to OriginHardHard
- House Robber IIHardHard
- Time Based Key-Value StoreHardHard
- Merge Triplets to Form Target TripletHardHard
- Word LadderHardHard
- Longest Consecutive SequenceHardHard
- Add Two NumbersHardHard
- House RobberHardHard
- Minimum Interval to Include Each QueryHardHard