Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SRM597 Div2 easy
class LittleElephantAndDouble:
def getAnswer(self, A):
m = max(A)
for a in A:
if not self.doubleUntilM(a, m):
return 'NO'
return 'YES'
def doubleUntilM(self, a, m):
print(a, m)
while(a <= m):
if a == m:
return True
a = a * 2
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment