Showing 3 questions
Rearrange the characters in a given string such that no two adjacent characters are the same. If such an arrangement is possible, return it; otherwise, return an empty string.
#1. Reorganize String
You're given a list of tasks to run, each requiring one unit of time to complete. Determine the shortest time needed to execute all tasks, considering a cooling period after each task execution.
#2. Task Scheduler
You're given a row of seats, some occupied and some empty. Find the best seat to maximize the distance to the nearest person.
#3. Maximize Distance to Closest Person