Codele / Algorithms

Two pointers

Two cards from a sorted row must add up to a target. Instead of trying every pair, put one finger at each end and move them towards each other.

Loading the playable lesson…