Pls let me know what is wrong with this code
- you cannot declare such a big array in stack memory
What the constraints are telling you is the range of the ELEMENTS, so you must use long long int datatype in this question. - Array of size n has indices from [0, n-1] so the loop must stop BEFORE n. It should be
i < n
here
this is the errror /bin/run.sh: line 4: 19 Segmentation fault (core dumped) ./exe