Anishluke92 / RubySolution

Problem solving using Ruby programming language
0 stars 1 forks source link

zipZap #35

Closed danielpaul closed 4 years ago

danielpaul commented 4 years ago

Look for patterns like "zip" and "zap" in the string -- length-3, starting with 'z' and ending with 'p'. Return a string where for all such words, the middle letter is gone, so "zipXzap" yields "zpXzp".

zipZap("zipXzap") → "zpXzp"
zipZap("zopzop") → "zpzp"
zipZap("zzzopzop") → "zzzpzp"