Function for int2str
Anonymous
public static String int2str(int x) { if (x == 0) return "0"; StringBuilder res = new StringBuilder(); while (x > 0) { res.insert(0, (char)('0' + x % 10)); x /= 10; } return res.toString(); }
Check out your Company Bowl for anonymous work chats.