Small Permutation Leetcode 46