DEV Community

Discussion on: Solution: Smallest String With A Given Numeric Value

Collapse
 
seanpgallivan profile image
seanpgallivan

Thanks for the input!

Indeed, some of my early answers to this problem used String.fromCharCode(97 + k % 25), but I found that defining the alphabet was actually more performant, at least using leetcode's timers.

Up until recently, I've been posting these solutions only on leetcode's forums, so my goal was to find the absolute most performant method given their testing methods. But since I've recently started aggregating my past solutions here, I've stripped out the references to leetcode times and plan from here on out to focus a bit more on strictly O(n) efficiency and readability and less on leetcode's often-capricious timers.