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.
The i[0] and j[0] are retrieving the score portion of the [score, name] nested lists. i for i in a means that each object i is each [score, name] sub-list within a. Since we don't want the whole list and do want only the score, the i[0] takes care of that.
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 →
The i[0] and j[0] are retrieving the score portion of the [score, name] nested lists.
i for i in a
means that each objecti
is each[score, name]
sub-list withina
. Since we don't want the whole list and do want only the score, thei[0]
takes care of that.