function exchangeNum(num) { let result; if (num > 0 && Number.isInteger(num)) { const numArr = [...num.toString()]; const startPostion = findChangePosition(numArr); const notNeedChange = numArr.slice(0, startPostion); const needChange = numArr.slice(startPostion); const maxNum = ...