Simple Solution
\n# Code\n\n# @param {String} s\n# @param {Integer} k\n# @return {String}\ndef get_smallest_string(s, k)\n    hash = {}\n    # Dump the alphabet into an array.\
\n# Code\n```\n# @param {String} s\n# @param {Integer} k\n# @return {String}\ndef get_smallest_string(s, k)\n    hash = {}\n    # Dump the alphabet into an array.\n    alphabet = ("a".."z").to_a\n\n    # Create a hash mapping all \n    # letters of the alphabet to the\n    # shortest distance to "a"\n    dist = 0\n    ("a".."n").each do |char|\n        hash[char] = dist\n        dist += 1 \n    end\n    dist = 12\n    ("o".."z").each do | char|\n        hash[char] = dist\n        dist -= 1\n    end\n    \n    # loop until we get k to 0 or\n    # we run out of chars to reduce\n    # to a lower lexicographical\n    # order.\n    chars = s.chars\n    i = 0\n    while k > 0 and i < chars.size\n        # Skip as it\'s minimized.\n        if chars[i] == "a"\n            i += 1\n        # If we have enough k to get our current\n        # char down to 0, reduce k and our char to "a"\n        elsif hash[chars[i]] <= k\n            k -= hash[chars[i]]\n            chars[i] = "a"\n            i += 1\n        # Otherwise reduce char as low as possible.\n        else\n            chars[i] = alphabet[alphabet.index(chars[i]) - k]\n            k = 0\n        end\n\n    end\n\n    chars.join\nend\n\n```
['Ruby']