| about | help | code help+videos | done | prefs |
letterPattern
Given a String s, int a, and int b, Create a letter pattern by taking every ath character in s and repeating it b times unless it is a space, in which case you should ignore it. Examples:
lettterPattern("Aaron",1,1) returns "Aaron", the same String because each character from the original string is repeated once.
lettterPattern("Aaron",1,2) returns "AAaarroonn" because each character from the original string is repeated twice.
lettterPattern("Aaron",2,2) returns "AArrnn" because every other character from the original string is repeated twice.
letterPattern("Aaron", 1, 1) → "Aaron" letterPattern("Aaron", 1, 2) → "AAaarroonn" letterPattern("Aaron", 2, 2) → "AArrnn" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200 Post-solution available
Copyright Nick Parlante 2017 - privacy