Problem Statement | |||||||||||||
The students at your university have lately picked up the annoying habit of missing classes. To fix this problem your board has decided to only allow students with 75% or higher attendance to sit for the exams. Given a String[] names containing the students' names and a String[] attendance containing their attendance records, return the list of students who have less than 75% attendance.
The ith student's name is given as the ith element of names and his attendance record as the ith element of attendance. The attendance record corresponding to each student is specified as a string of 'A's, 'P's and 'M's. An 'A' indicates the students was absent for a class, whereas a 'P' means he was present and a 'M' means he was absent but he submitted a doctor's note for that class. If a student was absent for a class but submitted a doctor's note then that class is not counted when calculating his attendance percentage. Return a String[] containing the names of all the students who do not meet the attendance requirements. The names in the returned String[] should be in the same relative order as names. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | names will contain between 0 and 50 elements, inclusive. | ||||||||||||
- | attendance will contain the same number of elements as names. | ||||||||||||
- | Each element of names will contain between 1 and 50 characters, inclusive. | ||||||||||||
- | Each element of attendance will contain between 1 and 50 characters, inclusive. | ||||||||||||
- | Each element of names will contain only letters ('A' - 'Z' and 'a' - 'z'). | ||||||||||||
- | Each element of attendance will contain only 'A', 'P' and 'M' characters. | ||||||||||||
- | Each element of attendance will contain at least one 'A' or 'P' character. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|