Maximum Swap Leetcode Javascript Problems Solving With Fraction