about | help | code help+videos | done | prefs |
Write a method that returns a string based on the 'orig' string, but with the back part of the string moved to the front and with 'add' inserted in the middle. The position to use when swapping the front and back of 'orig' is called 'pos'. For example, if 'orig' is "abcdefghij", 'pos' is 3, and 'add' is "-xyz-" you would return "defghij-xyz-abc" quiz2023_02_28_APP1SLHL_swap("st hereSpring Br", 7, "eak is almo") → "Spring Break is almost here" quiz2023_02_28_APP1SLHL_swap("I don't like making test data, but I have to do it.", 18, "SWARM") → "g test data, but I have to do it.SWARMI don't like makin" quiz2023_02_28_APP1SLHL_swap("water", 2, "swim") → "terswimwa" ...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