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.
In the Except block, You are trying to find the minimum value of the list. But you forgot one condition. What if your testcase has few elements with same number of occurance. For example,
X = [1,11,3,4,4,5,5,7,7,50]
Here, 4,5,7 all these three elements have same number of occurance.
We need to print the 4. But your program prints 1.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Mean, Median, and Mode
You are viewing a single comment's thread. Return to all comments →
In the Except block, You are trying to find the minimum value of the list. But you forgot one condition. What if your testcase has few elements with same number of occurance. For example,
X = [1,11,3,4,4,5,5,7,7,50]
Here, 4,5,7 all these three elements have same number of occurance.
We need to print the 4. But your program prints 1.