← Samsung questions

Matrix traversal direction change on encountering 1

Filed under Samsung

Given a matrix of 0s and 1s, start at (0,0) moving right. When encountering a 0, continue in the current direction. When encountering a 1, flip it to 0 and turn 90 degrees clockwise (right relative to…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.