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

 

Warmup-1 > everyNth
prev  |  next  |  chance

Given a non-empty string and an int N, return the string made starting with char 0, and then every Nth char of the string. So if N is 3, use char 0, 3, 6, ... and so on. N is 1 or more.


everyNth("Miracle", 2) → "Mrce"
everyNth("abcdefg", 2) → "aceg"
everyNth("abcdefg", 3) → "adg"

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

public String everyNth(String str, int n) { }

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

Copyright Nick Parlante 2017 - privacy