numOfCompleted function
Implementation
numOfCompleted(List<int> listLengths, int index) {
index = index + 1;
int val = 0;
for (int i = 0; i < listLengths.length; i++) {
if (listLengths[i] >= index) break;
val = listLengths[i];
}
return (index - val);
}