Most posted solution is Wrong in fact as the test cases are weak ....


  • -3
    2

    In fact, almost all the solutions are Wrong as the test cases are not complete enough ..

    Here is the test cases

       [1, 1, 3, 1]
    

    Such as the top voted solution as

    https://leetcode.com/discuss/19746/my-pretty-simple-code-to-solve-it

    You need to output your "lo" before return nums[lo].

        cout<<lo<<endl;
        return num[lo];
    

    In fact, the rotated position of this array should be 0, meaning lo should be 3....

    But your method returns 0. ....

    I find no posts can return the position "3" !!

    Although You can pass all the test cases in this problem, but the rotating position you return is wrong in fact ...

    I hope you can change your code to fix this problem , I have to say I have not found good solution to this problem ........

    The related problem cause my code WA in another question ....

    https://leetcode.com/discuss/89448/help-duplicate-rotation-position-find-error


  • 1
    W

    The problem requires to return the minimum number, not its position.


Log in to reply
 

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