Can Anyone Tell Me How You Gonna Guarantee a Win with $1 for n=2 ????

  • 0

    The problem description, based on my understanding, means how much money you need to GUARANTEE a win base on Optimal Strategy (binary search)

    How could you guarantee a win with $1 for n=2?

    my answer output 2 for n=2 but the leetcode answer is 1

  • 1

    that is simple, you should pick the smaller one rather than bigger one firstly. In this case only two possible ints are 1 and 2, we should guess 1 first. so the max loss is $1

  • 0

    @kira4 thanks. this is clear for me now.

Log in to reply

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