Student Attendance Record II (LeetCode 552)The problem An attendance record is a string of (present), (absent) and (late…