Skip to main content

Practice · 5 of 5

Fix the row swap

CHALLENGE
Difficulty: intermediate+25 XP

swapRows overwrites row a with row b and leaves row b untouched — the original row a is destroyed. Trace {1,2},{3,4} with a=0, b=1, then repair using the one-row temporary from the lesson.

Back to lesson: Practice: 2D array lab