ecobee Interview Question

Write an algorithm