HashedIn by Deloitte interview question

Time complexity problems, trees and graph question