Amazon interview question

1.Kadane's Algorithm 2. Number of islands