HackerEarth Average Subarray problem solution - TheCScience