You, leetcode
Back

LeetCode 2269. Find the K-Beauty of a Number

I feel particularly proud of this one, because I stuck with my goal of finding a solution that didn't involve parsing the number to a String, like a lot of other solutions did. And it paid off: using arithmetic like mod and division, my algorithm completed the test suite in 0ms.

The code listing and forum post are here:

https://leetcode.com/problems/find-the-k-beauty-of-a-number/discuss/2040570/Java-0ms-beats-100-uses-fast-purely-arithmetic-algorithm-(no-atoi-or-Integer.parseInt())