Search
⌘K

Leetcode 626. Exchange Seats

Given a table of students with consecutive integer ids starting at 1, return the rows where each adjacent pair of students (ids 1&2, 3&4, ...) have their seat ids swapped while leaving the final row unchanged if the count is odd, and order the result by id ascending.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.