id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

srp4379@lausd.net > insideOut
prev  |  next  |  chance

insideOut(String) reverses the characters in both the first half and the last half of the string. If the string has an odd number of characters, the middle character is unaffected.

SOLVE THIS PROBLEM WITHOUT A LOOP!
You will need to use the following HELPER function:
String stringReverse(String str) {
  StringBuffer buffer = new StringBuffer(str);
  buffer = buffer.reverse();
  return buffer.toString();
}
RUBRIC: It is not enough to just solve the problem. Make sure you use PROPER INDENTATION. You MUST use CURLY BRACKETS for all if/else statements. Also, the more EFFICIENT your solution, the higher your grade. If you have extraneous (superfluous / unnecessary) code, deductions will be taken.

insideOut("LOOTS-speed") → "STOOL-deeps"
insideOut("denimSTRAP") → "minedPARTS"
insideOut("PEELSserif") → "SLEEPfires"

...Save, Compile, Run (ctrl-enter)

String insideOut(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy