Please help me with the below problem

Please format your code - the forum software has mangled it and it won’t compile! :slight_smile:

Edit:

Meh - I guess I can guess what your code is supposed to look like. Consider the test input:

3
3 2 1
2 2 2