#Java 7, 81 bytes
Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..
Explanation:
int i=0; // Temp integer `i` (on class level)
String c(int n){ // Method with integer parameter and String return-type
return i<n? // If `i` is smaller than the input integer
c(n-++i) // Return a recursive call with input minus `i+1` (and raise `i` by 1 in the process)
: // Else:
Long.toString(i,36)+ // Return `i` as Base-36 +
(n>(i=0)? // (If the input integer is larger than 0 (and reset `i` to 0 in the process)
c(n) // Recursive call with the input integer
: // Else:
""); // an empty String)
} // End of method
#Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..
Explanation:
int i=0; // Temp integer `i` (on class level)
String c(int n){ // Method with integer parameter and String return-type
return i<n? // If `i` is smaller than the input integer
c(n-++i) // Return a recursive call with input minus `i+1` (and raise `i` by 1 in the process)
: // Else:
Long.toString(i,36)+ // Return `i` as Base-36 +
(n>(i=0)? // (If the input integer is larger than 0 (and reset `i` to 0 in the process)
c(n) // Recursive call with the input integer
: // Else:
""); // an empty String)
} // End of method
Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..
Explanation:
int i=0; // Temp integer `i` (on class level)
String c(int n){ // Method with integer parameter and String return-type
return i<n? // If `i` is smaller than the input integer
c(n-++i) // Return a recursive call with input minus `i+1` (and raise `i` by 1 in the process)
: // Else:
Long.toString(i,36)+ // Return `i` as Base-36 +
(n>(i=0)? // (If the input integer is larger than 0 (and reset `i` to 0 in the process)
c(n) // Recursive call with the input integer
: // Else:
""); // an empty String)
} // End of method
#Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..
Explanation:
int i=0; // Temp integer `i` (on class level)
String c(int n){ // Method with integer parameter and String return-type
return i<n? // If `i` is smaller than the input integer
c(n-++i) // Return a recursive call with input minus `i+1` (and raise `i` by 1 in the process)
: // Else:
Long.toString(i,36)+ // Return `i` as Base-36 +
(n>(i=0)? // (If the input integer is larger than 0 (and reset `i` to 0 in the process)
c(n) // Recursive call with the input integer
: // Else:
""); // an empty String)
} // End of method
#Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..
#Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..
Explanation:
int i=0; // Temp integer `i` (on class level)
String c(int n){ // Method with integer parameter and String return-type
return i<n? // If `i` is smaller than the input integer
c(n-++i) // Return a recursive call with input minus `i+1` (and raise `i` by 1 in the process)
: // Else:
Long.toString(i,36)+ // Return `i` as Base-36 +
(n>(i=0)? // (If the input integer is larger than 0 (and reset `i` to 0 in the process)
c(n) // Recursive call with the input integer
: // Else:
""); // an empty String)
} // End of method
#Java 7, 81 bytes
int i=0;String c(int n){return i<n?c(n-++i):Long.toString(i,36)+(n>(i=0)?c(n):"");}
Port from @Arnauld's amazing JavaScript (ES6) answer.
My own approach was almost 2x as long..