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.
publicstaticintgetTotalX(List<Integer>a,List<Integer>b){// Write your code hereintfirst=a.get(a.size()-1),end=b.get(0);intcount=0;for(intstart=first;start<=end;start+=first){booleanstatus=true;for(intnum:a){if(num>start||start%num!=0){status=false;break;}}if(status){for(intval:b){if(val<start||val%start!=0){status=false;break;}}if(status)count++;}}returncount;}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →