ACKO General Insurance interview question

Find subarray with given sum and trees