Unable to understand the problem with my code

I have submitted the solution for the given problem and my code is running perfectly. Upon submission, however, I am being told that my answer is wrong. Kindly go through my code or provide me the correct answer so that I can understand where I am going wrong.

Errors: Re-declaration of max and Roses inside if conditions. Correct them.

and you code Complexity :is O(T * N^2).

You Can refer my code as well

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I am able to correct the re-declaration of max in if conditions. However, I am unable to understand how I can correct the re-declaration of roses array as I will have to write “int Roses[]={Price[j],Price[k]}” to add the prices in the array.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.