about | help | code help+videos | done | prefs |
Write a method that accepts a string 'str' and the number of times to repeat that string 'count'. Return a new string with 'str' occurring 'count' times with a space between each occurrence of 'str'. There must NOT be a space before the first copy of 'str' nor after the last copy of 'str'. Note that 'count' could be zero, in which case return an empty string. feb5_2016_APSLHL_duplicateString("test", 3) → "test test test" feb5_2016_APSLHL_duplicateString("nothing", 0) → "" feb5_2016_APSLHL_duplicateString("win", 1) → "win" ...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: 290
Copyright Nick Parlante 2017 - privacy