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

 

jebbert@volusia.k12.fl.us > balrogScramble
prev  |  next  |  chance

BalrogScramble accepts a string and an integer, num, as input parameters. The parameter num will be between 2 and half the length of the string. Your first task is to figure out how num determines how the string gets scrambled. Look at the test data and it should be clear! Write a method that performs this scramble.


balrogScramble("abcdefghijklmnop", 2) → "acegikmobdfhjlnp"
balrogScramble("abcdefghijklmnop", 3) → "adgjmpbehkncfilo"
balrogScramble("abcdefghijklmnop", 4) → "aeimbfjncgkodhlp"

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

public String balrogScramble(String orig, int num) { }

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: 290

Copyright Nick Parlante 2017 - privacy