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.
publicstaticintbirthday(List<Integer>s,intd,intm){// Write your code hereintcount=0;if(s.size()<=1){returncount+1;}for(inti=0;i<s.size();i++){intsum=0;for(intj=i;j<m;j++){sum+=s.get(j);}if(sum==d){count++;}m++;if(m>s.size()){break;}}returncount;}}
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 →
Easy Solution in Java