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.
Choose and Calculate
Choose and Calculate
Sort by
recency
|
16 Discussions
|
Please Login in order to post a comment
Precalculate number of ways to form subsets with n as minimum/maximum for valid n.
Use of (n+1)Cr = nCr * (n+1)/(n+1-r) for efficient calculation of nCr for incrementing n and fixed r
O(n) solution
def solve(balls, k): MOD = 10**9+7 result = 0 n = len(balls) balls.sort()
Hi everyone, I get TLE for the last 4 test cases... please advise me on how to optimize the code. Thank you!
>
I am running a scholarships website for international students on wordpress. Can I use this,"Choose and Calculate" functions in my website for smooth and easy data input?
have coded the following (naive) O(n^2) solution code below. (Sorry HackerRank people for posting code, I'll not do it again :-) ) It passes only a few test cases and times out as I expected on others. Can anyone see a problem with the logic?
Could someone explain what the loops mean? This is taken from Editorial