Skip to content

Instantly share code, notes, and snippets.

@betaprojects
Last active August 14, 2021 00:59
Show Gist options
  • Save betaprojects/77f8703df437cba40a22d9edb4e12c26 to your computer and use it in GitHub Desktop.
Save betaprojects/77f8703df437cba40a22d9edb4e12c26 to your computer and use it in GitHub Desktop.
Project Euler & HackerRank problem 99 solution: Find the largest exponential from a list of base/exponent pairs - solved using Python
# HackerRank solution
from math import log
v = []
for _ in range(int(input())):
a, b = map(int, input().split())
v.append((b*log(a), a,b))
k = int(input())
x, a, b = sorted(v)[k-1]
print (a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment