about | help | code help+videos | done | prefs |
Write a method that takes a string input parameter and returns a new string based on the input parameter but with dashes inserted between each consecutive characters in such a way that each new insertion of dashes has one more dash than the previous one. For example, the string "this" becomes "t-h--i---s". Do NOT insert any dashes after the last character. If the string only has one character or is empty, simply return the original string. nov3_2017_APSLHL_stringDash("this") → "t-h--i---s" nov3_2017_APSLHL_stringDash("A") → "A" nov3_2017_APSLHL_stringDash("") → "" ...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: 280
Copyright Nick Parlante 2017 - privacy