Goldman Sachs Analyst SWE OA 2021
Anonymous User
4995

120 minutes to complete on Hackerrank

  1. Tag Identification Number

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'))

	

2. https://leetcode.com/problems/delete-and-earn/

Comments (3)