You are viewing a single comment's thread. Return to all comments →
I didnt well understand that what will happen if b+1 is out of array bounds?
it can't be out of bounds, it saids that b>n in the problem statement.
if b+1 > n then the the addition of k from position a will continue till the last element of the array.
Hi,
I have uploaded a video tutorial which can help you to understand the problem as well as logic.
Here is the video tutorial for my solution O(n+m) complexity.
https://youtu.be/hDhf04AJIRs
Would really appreciate your feedback like, dislike , comment etc. on my video.
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
I didnt well understand that what will happen if b+1 is out of array bounds?
it can't be out of bounds, it saids that b>n in the problem statement.
if b+1 > n then the the addition of k from position a will continue till the last element of the array.
Hi,
I have uploaded a video tutorial which can help you to understand the problem as well as logic.
Here is the video tutorial for my solution O(n+m) complexity.
https://youtu.be/hDhf04AJIRs
Would really appreciate your feedback like, dislike , comment etc. on my video.