The Trade Desk Interview Question

matrix manipulation, leetcode mediums (near hard level)