MulticoreWare Interview Question

Island perimeter program question from the leetcode platform