<reponame>DevashishPathrabe/LeetCode<filename>LeetCode Solutions/LeetCoding Challenge/January 2021 LeetCoding Challenge/Smallest String With A Given Numeric Value/Smallest String With A Given Numeric Value.js<gh_stars>0/**
 * @param {number} n
 * @param {number} k
 * @return {string}
 */
var getSmallestString = function(n, k) {
    k -= n
    let numericValue ='caf86f4uutaoxfysmf7anj01xl6sv3ps',
        lexicographicallySmallestString = 'z'.repeat(~~(k / 25))
    if (k % 25)
        lexicographicallySmallestString = numericValue[k % 25] + lexicographicallySmallestString
    return lexicographicallySmallestString.padStart(n, 'a')
};