TweakCode
Search lessons
Loading editor…
Test casesRun to compare output
Input
head = [1,2,3,4,5], k = 2
Output
—
Expected
[2,1,4,3,5]

More practice

Same technique, different problems. Try them without the walkthrough.