bp interview question

least weighted path 2d grid