120 minutes to complete on Hackerrank
You're given a string containing a list of digits. You must make as many IDs of the format 8xxxxxxxxxx (an 8 followed by 10 digits) as possible. Return the number of IDs you can make. The IDs do not have to be unique, and you may rearrange the digits, but you may only use each digit once.
def answer(digits):
return min(len(digits)//11, digits.count('8'))