Solutions for Dash Insert
View the challenge

This challenge requires you to insert a dash character between each two odd numbers. For example, if the string is "13566" then your program should return "1-3-566" To solve this challenge, we'll loop through the string checking if the current number is odd and if the next number is odd as well. To check if a number is odd we'll use the modulo function which returns the remainder after a division operation.



You need to be a member to see the rest of this solution and code.