This solution is outdated. To rescore this solution, sign in.
-
2 Comments
How can the above solution be improved?
You can use Gauss formula for triangular numbers. It will improve performance. It won't improve Cody size. To improve Cody size, you need hack. Popular hack is to wrap the code into regular expression. Somebody invented it to cheat scoring algorithm and it spreaded among cody submissions like a cancer. I'm not proud of this, I was using this hack too, fortunately realised that it makes no sense. Advice: don't care so much about the size, care about quality code. Most of super small solutions use some sort of cheats, you won't learn much from those.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!