@Christian, This is flagged for the use of "str2num" to cheat by reducing the solution size, though it does not have bear any such impact now.
I believe it is best to discourage this practice and also inform people not to do so as well, specifically when contributes nothing to the code and can cause trouble given that "str2num" uses" eval".
I personally feel that since you can't execute arbitrary code with str2num() - in particular, unlike with the usual regexp cheat, you can't hide arbitrary code in it to get to size 10 -, it's valid in golfing.
I'd not recommend doing this in production code, of course, but that goes for pretty much all code golfing practices.
Group
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
太nb了
Shouldn't be flagged - this is a valid solution.
@Christian, This is flagged for the use of "str2num" to cheat by reducing the solution size, though it does not have bear any such impact now.
I believe it is best to discourage this practice and also inform people not to do so as well, specifically when contributes nothing to the code and can cause trouble given that "str2num" uses" eval".
Oh, I didn't know it used eval, interesting.
I personally feel that since you can't execute arbitrary code with str2num() - in particular, unlike with the usual regexp cheat, you can't hide arbitrary code in it to get to size 10 -, it's valid in golfing.
I'd not recommend doing this in production code, of course, but that goes for pretty much all code golfing practices.