What is the process of getting this answer. The answer is 917328 but I don't understand how to work it out.
What value does mystery(918273) return?
public static String mystery(int x)
{
String s = "";
for (int k = x; k > 0; k = k / 10)
{
if (k % 2 == 0) s = s + k % 10;
else s = k % 10 + s;
}
return s;
}