Hudson River Trading: Players racing past a watcher that flips direction
Problem. Players stand on a road from position 0 to position L. Each player can only move right, one unit per second. A watcher starts at position W facing left and walks one unit per second in the direction it faces. Any player in the watcher's field of view must stand still; others may move. You are given the times at which the watcher turns around. Given a time limit T, count how many players reach L within T.
Example. T = 2, players at 1 and 4, W = 3, L = 5, one turn at time 1. The answer is 1.
Format. Explained verbally in a medium-difficulty technical screen, coded in a shared editor.
What to clarify. The post did not define the field of view exactly, so pin down whether a player directly at the watcher's position, or behind it, counts as seen before you start coding.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.