Question about copy an array


  • 0
    Y

    Hi guys, I just follow the editorial solution about this problem. There is a solution that we can form a new array to store the final result. The process of returning the value of new array to nums is by using a for loop.
    I'm wondering that why I get the wrong answer by using clone() or Arrays.copyOf()? Some one can tell me why? Thanks


Log in to reply
 

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