Binary Array Sorting Leetcode Sql