The solution seems not correct as they done sorting at first. If you check, that will be great. Thanks.