My code on Maxsub array sum is giving wrong answer on submission


is my code link which is running perfectly on test cases
but on submissoion giving wrong answer

@Adarshrajpandey You are not passing the map by reference. Enter & in front of the map declaration in the function.
Also this problem can be easily solved using kadanes algorithm I would recommend that you must solve it using kadanes algorithm which is really simple.

i have put & sir but it is still givig wrong answer

@Adarshrajpandey Have you used kadanes algorithm to solve this problem?.

yes sir i will use it

Okay sure do it and it will be solved