https://gist.github.com/johntran - > big2019Feb19.md
Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum and return the subarray.
Input: {4, 2, -3, 1, 6}
Output: [2, -3, 1]
There is a subarray with zero sum from index 1 to 3.
Input: {4, 2, 0, 1, 6}
Output: [0]
There is a subarray with zero sum from index 2 to 2.
Input: {-3, 2, 3, 1, 6}
Output: []
There is no subarray with zero sum.
Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5 islands
Input : mat[][] = {{1, 1, 0, 0, 0},
{0, 1, 0, 0, 1},
{1, 0, 0, 1, 1},
{0, 0, 0, 0, 0},
{1, 0, 1, 0, 1}
Output : 5