We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I have a valid solution that cannot pass any of the tests. I have checked the output with other solutions that pass the hidden test cases. What am I doing wrong?
defsolve(a,b,c):# Write your code hereM=max(a,b)m=min(a,b)A=max(0,min(M,c-m))B=max(0,min(c,M))H=max(0,min(c,m))nom=(A+B)*Hdenom=2*M*mgcd=math.gcd(nom,denom)return'%s/%s'%(nom// gcd, denom // gcd)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Random number generator
You are viewing a single comment's thread. Return to all comments →
I have a valid solution that cannot pass any of the tests. I have checked the output with other solutions that pass the hidden test cases. What am I doing wrong?