Why Input: [1,2] Expected: 1?


  • 0
    T

    the requirement is to find h such that"A scientist has index h if h of his/her N papers have at least h citations each, and the other N − h papers have no more than h citations each."

    for input[1,2], when h=1 means 1 of the paper has at least 1 citations, which is clearly not true, since 2 papers have at least 1 citations

    please help me understand this test case....


  • 0
    X

    h = 2 means that there are 2 papers having at least 2 citations


  • 0
    T

    that's correct... so 2 is not the answer either....


  • 0
    X

    but h = 1 stands, because there exists 1 paper which has at least 1 citation


  • 0
    T

    i don't think h=1 is the answer..because there are 2 paper (1,2) which have at least 1 citation


  • 0
    X

    h means that there are h papers which have at least h citations. the largest h which holds the definition is the answer.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.