Bluetooth*

Question

Solution

Idea

Time Complexity: O(1)O(1) or O(n)O(n)

My idea is to create an long array to store the health status for all 32 teeth, 0 for healthy, 1 for missing and 2 for blue.

Then, iterate through this array and update the health status of left_upper, left_lower, right_upper and right_lower.

Lastly, we use these four variables to get the overal health status, left_okie and right_okie.

Code

C

https://github.com/nus-cs1010/libcs1010/blob/master/src/cs1010.c

Last updated