can someone tell why this solution is returning [3,2,1] for input [3,2,1]? Is the highlighted line(with !!!!!!s) not doing anything?

Thanks!

```
class Solution(object):
def nextPermutation(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
if len(nums) < 2:
return
# check if descending order already
k = -1
for i in range(len(nums) - 2, -1, -1):
if nums[i] < nums[i + 1]:
k = i
break
if k == -1:
nums = nums[::-1] # !!!!!!!this line not working?!!!!!!!!!
return
# rearrangement
l = -1
for j in range(len(nums) - 1, k, -1):
if nums[j] > nums[k]:
l = j
break
nums[l], nums[k] = nums[k], nums[l]
nums[k + 1:] = sorted(nums[k + 1:])
```