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 hereintresult=0;intcount=0;inti=0;booleanisFinished=false;while(!isFinished){if(s.size()==1&&s.get(i)==d){result=result+1;isFinished=true;}count=s.get(i);for(intj=i+1;j<i+m;j++){count=count+s.get(j);System.out.println(j);if((j+1)==s.size()){isFinished=true;}}if(count==d&&s.size()!=1){result=result+1;}i++;}returnresult;}}
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 →