Amazon Interview Question

1.Kadane's Algorithm 2. Number of islands