For example, for N = 3.
The **permutations** are: 

```
[1,3,2]
[2,3,1]

```

Note: `[1,2,3]` and `[3,2,1]` are not valid here because `[1,2,3]` increases but doesn't decreases and vice-versa for `[3,2,1]`.

I got this problem in TCS CodeVita 2017, they didn't even provide the editorial for this.