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.
Clever, took me a minute to understand what you did. More efficient than re-adding each series of ints in embedded loops.
Quick Summary of what was done:
1) The first loops adds the first m ints together to see if they equal d.
2) The second loop removes the first digit from the last calculation, and adds a later one to replace it.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →
Clever, took me a minute to understand what you did. More efficient than re-adding each series of ints in embedded loops.
Quick Summary of what was done: 1) The first loops adds the first m ints together to see if they equal d. 2) The second loop removes the first digit from the last calculation, and adds a later one to replace it.