Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let delimiter = input.pop();
- let result = '';
- let lastResult = '';
- for(let str of input) {
- result += str + delimiter;
- lastResult = result.substring(0, result.length - 1);
- }
- console.log(lastResult);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement