Array And Simple Queries Hackerrank Solution In C