Preserve a value before replacing it

A workshop stores its tool allocations in three variables: north starts at 12 tools, east at 18 tools, and south at 9 tools. Tomorrow's allocation must give north today's east allocation, east today's south allocation, and south today's north allocation, using the original values.


The following steps run from top to bottom. Each copy immediately replaces the destination's value. Fill each blank with one variable name chosen from north, east, south, and saved.

  1. Copy into saved.
  2. Copy east into north.
  3. Copy south into east.
  4. Copy into south.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Problem Solving and Algorithms Questions: