1 day ago · Tech · 0 comments

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.

No comments yet. Log in to reply on the Fediverse. Comments will appear here.