Google interview question

Leet code problem - Course Schedule