Hi All,
in your opinion if your asked to answer the maximum number swap question by Amazon and as an example a number like 11432 is provided, and you are asked to return the largest number by swapping two digits side by side only to create the largest number. the largest possible number is 41132. I am interested in the Java platform. I assumed the correct answer is using remainder operator, i e. modulus, i.e. number%(int)Math.pow(10D,5D)/...*...,, and would rather do char array chars element swap. its easier, makes so much more logical sense, and is easier to read and understand, unless a low level implementation of 1 in a million would benefit from using modulus without arrays in the performance mod. Whats the right answer to give an interviewer asking this question