SafetyCulture Interview Question

Coding question based on manipulating maps / arrays to certain criteria