Q3 Technologies interview question

DSA basics- arrays, graph then math puzzles