-
2 Comments
Khaled Hamed
on 1 Aug 2012
The problem asks to "add" a zero, no mention of append or prepend! Nice general solution though, and a new trick learned ($&0)
Donovan Greene
on 22 Jun 2017
I feel I've overcomplicated my solution
regexprep(x, '(?(?=0[^0]|0$)0|)', '00')
Suggested Problems
-
299 Solvers
-
Back to basics 9 - Indexed References
448 Solvers
-
Permute diagonal and antidiagonal
468 Solvers
-
The Answer to Life, the Universe, and Everything
550 Solvers
-
334 Solvers
More from this Author43
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!