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.
can U explain me about 2 lines of your code?:
for(auto it = s.cbegin(); it != s.cend(); ++it){
if(d == std::accumulate(it, it + m, 0))
I think a accumulate will sum element out of vector, I think it will be it != cend() - m more saver.
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 →
can U explain me about 2 lines of your code?:
for(auto it = s.cbegin(); it != s.cend(); ++it){ if(d == std::accumulate(it, it + m, 0))
I think aaccumulate
will sum element out of vector, I think it will beit != cend() - m
more saver.