← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of pins (as integer values) and corresponding categories. Reorder them such that no two adjacent pins share the same category. If it is impossible to achieve this, return an empty list.
The goal is to return any valid ordering of pins that satisfies the adjacency constraint. The problem is framed in the context of reorganizing pins on Pinterest boards to avoid consecutive pins of the same category, ensuring a visually diverse feed.