7 kyu

Insert dashes

5,110 of 9,184joh_pot

Description:

Write a function that takes an integer num (num >= 0) and inserts dashes ('-') between each two odd digits in num.

Examples

454793 ---> "4547-9-3"
     0 ---> "0"
     1 ---> "1"
13579  ---> "1-3-5-7-9"
 86420 ---> "86420"
Strings
Arrays
Fundamentals

More By Author:

Check out these other kata created by joh_pot

Stats:

CreatedJul 3, 2015
PublishedJul 3, 2015
Warriors Trained15099
Total Skips917
Total Code Submissions27749
Total Times Completed9184
JavaScript Completions5110
CoffeeScript Completions35
Python Completions2407
Ruby Completions579
C# Completions390
Java Completions833
C Completions65
COBOL Completions3
Total Stars182
% of votes with a positive feedback rating92% of 1090
Total "Very Satisfied" Votes943
Total "Somewhat Satisfied" Votes130
Total "Not Satisfied" Votes17
Ad
Contributors
  • joh_pot Avatar
  • g964 Avatar
  • GiacomoSorbi Avatar
  • MMMAAANNN Avatar
  • joecastle Avatar
  • dinglemouse Avatar
  • Souzooka Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • yLaWy Avatar
Ad