1718. Construct the Lexicographically Largest Valid Sequence - Explanation

Problem Link