Integer Replacement Leetcode Sql