Daily challenge for 2025-01-29
29. Queue Reconstruction by Height
Write a function solve that reconstructs a queue based on the heights of people and the number of people in front of them. Each person is represented by a pair [h, k], where h is the person's height and k is exactly equal to the number of people in front of this person (BEFORE them in the list) who have a height greater than or equal to h.
Example:Input: [[7,0],[4,4],[7,1],[5,0],[6,1],[5,2]]Output: [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]
Run this challenge interactively in Python or JavaScript when the app loads.