about | help | code help+videos | done | prefs |
test2023_09_08_P1SLHL_mashUp
Write a method that "mashes up" two strings by using the first 'num1' characters out of 'str1' followed by the first 'num2' characters in 'str2'. However, if either of the numbers ('num1' or 'num2') is greater than the number of characters in their respective strings, just use that whole string. NOTE: You may assume that 'num1' and 'num2' Look at the test data for examples. test2023_09_08_P1SLHL_mashUp("You are not my...", 2, "dad", 2) → "Yoda" test2023_09_08_P1SLHL_mashUp("I think that was something to do with", 2, "Luke and Vader", 4) → "I Luke" test2023_09_08_P1SLHL_mashUp("$^*##@", 1, "What???", 1) → "$W" ...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: 220
Copyright Nick Parlante 2017 - privacy