Problem 865. Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1).
For example:
'1010' -> '100100' '0110' -> '001100' '1000' -> '10000' '1111' -> '1111'
Solution Stats
Problem Comments
-
1 Comment
Pablo Lobo
on 4 Jan 2017
Didn't really understand the problem right from reading the task itself, but from reading the test cases. Really fun problem though. First time I used regexprep function, so I learned a lot!
Solution Comments
Show commentsProblem Recent Solvers317
Suggested Problems
-
6115 Solvers
-
Extract leading non-zero digit
2134 Solvers
-
2723 Solvers
-
Create matrix of replicated elements
378 Solvers
-
Integer Sequence - II : New Fibonacci
491 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!