Sort 259 Discussions, By:
Please Login in order to post a comment
Here are 3 ways to convert an int to a String
String s = String.valueOf(n);
String s = Integer.toString(n);
String s = "" + n;
From my HackerRank Java solutions.
I assume this problem was incorrectly marked as Difficult.
Simple solution that works since Java's + operator is "overloaded" in the sense that it concatinates strings at compile-time.
a single line of code can get you your 10 points.....teeheee