Algorithm · Uber · Medium
Snake Board Rearrangement Medium · Matrix, Simulation, Sorting · Uber · Hint You are given an n by n integer matrix board that contains every integer from 1 to n * n exactly once, arranged arbitrarily. Your task is to transform the board into a snake configuration: the first row must be strictly increasing from left to right, the second row strictly increasing from right to left (i.e., decreasing when read left to right), the third row increasing left to right, and so on,…
Checking your access…