ByteDance Interview Question

1). 2 dimensional graph algorithm