Attendance

Question

Solution

Idea

This question is an array manipulation problem. The idea is easy:

  1. First Iteration is to mark the attendance: we start from the second entry and if encounter "Present!", mark the previous name as present.

  2. Second Iteration is to print the absence: we start from the first entry and if the name is not "Present!" and its absence is false, print out the absent student's name.

But the implementation may depends individually. Personally, I used struct in C to solve it.

Code

https://github.com/mendax1234/Coding-Problems/blob/main/kattis/attendance2/attendance2.c

Last updated