We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Great solution. Helped me solve my time issue.
I had to make adjustments to the array size. If you have issues with 4 test cases after using this advice. Try doing:
long int *a=new long int[N+2]()
I am not sure where, but the array had some memory breaches even though it provided correct answer.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
Great solution. Helped me solve my time issue. I had to make adjustments to the array size. If you have issues with 4 test cases after using this advice. Try doing:
long int *a=new long int[N+2]()
I am not sure where, but the array had some memory breaches even though it provided correct answer.