1700-number-of-students-unable-to-eat-lunch
DevGod needs to write a blog entry for this problem!
/**
* @param {number[]} students
* @param {number[]} sandwiches
* @return {number}
*/
var countStudents = function(students, sandwiches) {
while(students.length > 0){
if(students[0] !== sandwiches[0]){
students.push( students.shift() );
}else{
students.shift();
sandwiches.shift();
}
if(!students.includes(sandwiches[0])){
return students.length;
}
}
return 0;
};