You should run one of the test cases and see what happens. You will get an error.
This here says that you want to set arr to be an empty array and never change what array you are using, but then on the very next line you change which array arr is talking about. This generates an error, as you cannot reassign a const variable.