Orderly Queue

easy
https://leetcode.com/problems/orderly-queue/

Input Format

CHECK THE LINK

Output Format

CHECK THE LINK

Constraints

CHECK THE LINK

Notice

CHECK THE LINK

Example

Input

        
Output

        
Previous
Pancake Sorting
Next
Count Submatrices With All Ones

Related Questions