Given a list of streamed patients consisting of names DOB da

Given a list of streamed patients (consisting of names, DOB, date last seen), return the 3 most recently seen patients from that list. in java

Solution

Criterion topPercentFromRange(Comparator<Widget> cmp, double from, double to) {
return stream -> {
List<Widget> temp =
stream.sorted(cmp).collect(toList());
           stream.limit(3); //will limit 3 items
return temp.stream()
.skip((long)(temp.size() * from))
.limit((long)(temp.size() * (to - from)));
};
}

Given a list of streamed patients (consisting of names, DOB, date last seen), return the 3 most recently seen patients from that list. in javaSolutionCriterion

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site