about | help | code help+videos | done | prefs |
Write a method that creates a new string given two strings 'str1' and 'str2' and an amount to jump by called 'jmp'. Create the new string by jumping through the other two strings and using characters from the strings to building the new string. Always pull from 'str1' first then 'str2'. Stop when either string runs out of characters. For example, if 'str1'="abcdefghij" and 'str2'="12345" and 'jmp'=2 you would return "a1c3e5". Make sure you understand why this would be the result. As a precondition, you may assume that 'jmp'>0. quiz2022_03_09_APSLHL_mixStrings("A", "Z", 43) → "AZ" quiz2022_03_09_APSLHL_mixStrings("Tigger", "Piglet", 3) → "TPgl" quiz2022_03_09_APSLHL_mixStrings("bubblegum", "monkey", 2) → "bmbnle" ...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: 240
Copyright Nick Parlante 2017 - privacy