Comment body goes here.
these are standard questions ,you cant blame/say they are copied,and the question is correct and there are no bugs,see the number of submissions,your code and you are buggy
it’s works fine !! , maybe this question copied from Facebook and other companies interviews .