Multiple ChoiceIntermediate 30s
Two Pointers: Palindrome Check
Checking if a string is a palindrome with two pointers:
Options
- 1Push every character onto a stack, then pop and compare with the original order
- 2Sort the string first, then compare the sorted result with the reversed original
- 3Start pointers at left and right ends, move inward comparing characters
- 4Use binary search on the sorted string to find each character's mirror position
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.