I am trying to implement a backtracking algorithm in JS to find the minimum value possible by swapping k digits.
I can\'t see why my code doesn\'t work. If I log out