Back to problems

Movement Command Controller

Algorithm · Goldman Sachs · Easy

Requirements Read a string of directional commands representing upward, downward, leftward, and rightward moves. Update the tracked coordinates through a switch statement or an equivalent dispatch lookup. Follow-up: accept command letters regardless of whether they are uppercase or lowercase. Because the interface details are absent, agree on the starting coordinates, axis directions, treatment of unrecognized characters, and return format before implementation. Illustrative…

Checking your access…