why i can't use int i = (int)Math.round(Math.random()*(list.size()-1));


  • 0
    W

    if i use int i = (int)Math.round(Math.random()*(list.size()-1)); return wrong answer but if i use r.nextInt(list.size()); it can accepted


Log in to reply
 

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