Hi, I was going through the solutions for this question Mike and Distributions and wrote this ->Solution<- using some hints from some others solution.
Help me, I can't figure out why this solution even passes as it would have given TLE. Thanks in advance.