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.
@HAMZA_SHAKEEL First two lists are created as marksheet and scorelist. marksheet is used to store the values of all the inputs more like a dictionary while the scorelist recores only the scores.
input is put into the range() to make sure there are enough inputs taken for all the inputs gievn and also because we camt be so sure about th amount of inputs.
Then the scores, marks are stored by
marksheet+=[[name,score]]
scorelist+=[score]
b=sorted(list(set(scorelist)))[1] The second lowest score is taken out to the element b by the index[1].
Then for a,c (a and c are used for the loop process. Nothing special with the functionality of the programme) in the range, all the names which bears the score b is printed.
And a special note must be made, this may look like its forgetting that the test cases might have more than one lowest score. That issue has been addressed by the use of set(). A set does not have duplicate items. Therefore the check is valid and accurate.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
And a special note must be made, this may look like its forgetting that the test cases might have more than one lowest score. That issue has been addressed by the use of set(). A set does not have duplicate items. Therefore the check is valid and accurate.