188 days ago · Tech · hide · Fediverse post

The challenge Given an array of positive integers, return the number with the most digits. If two or more numbers share the highest digit count, return the first one that appears in the array. Examples: findLongest(new int[]{1, 10, 100}); // → 100 findLongest(new int[]{9000, 8, 800}); // → 9000 findLongest(new int[]{8, 900, 500}); // → 900 This puzzle appears on Codewars and HackerRank in Java tracks. The first-match tie-breaker is the part candidates miss most often.

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