We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9bdaa34 commit df5186dCopy full SHA for df5186d
1 file changed
Easy-Programming-Challenges/DashInsert.js
@@ -0,0 +1,11 @@
1
+function DashInsert(str) {
2
+ var newA=[];
3
+
4
+ for(var i =0; i<str.length; i++){
5
+ newA.push(str[i]);
6
+ if(str[i] %2 !==0 && str[i+1]%2 !==0 && str[i+1] !== undefined){
7
+ newA.push("-");
8
+ }
9
10
+ return newA.join("").toString();
11
+}
0 commit comments