Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
Given the following function:
public String mystery(String s) { if (s.length() == 2) { return s; } return mystery(s.substring(1)) + s.substring(0,1); }
What would be printed from the following statement?
System.out.println(mystery("CodeHS"));
HSedoC
CodeH
HedoC
CodeHS
SHedoC