177 days ago · Tech · hide · Fediverse post

This is the index for the four programming puzzle problems on this site. Each one has language-specific solutions in JavaScript, Java, Python, or Go — pick the variant that matches what you’re working in. Every solution is tested, runs in linear time, and includes the trade-off between the idiomatic approach and the manual one. Find the number with the most digits Given an array of positive integers, return the one with the most digits. If two have the same digit count, return the first occurrence. The trick is choosing between String(n).length (idiomatic, slightly slower) and Math.log10(n) + 1 (mathematical, faster on hot paths).

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town