Leetcode 2717. Semi-Ordered Permutation | Hello Interview