ByteDance Interview Question

Coding exercise about island question using BSF