Update NextPermutation.java

Submission Result: Runtime Error

Last executed input:	[1,2,0,3,0,1,2,4]
 L 31