ADmyBRAND interview question

Graph based LC