Competitive Programming

Hackerearth : Help Ashu

Problem Statement: https://www.hackerearth.com/practice/data-structures/advanced-data-structures/fenwick-binary-indexed-trees/practice-problems/algorithm/help-ashu-1/ Approach : We can solve the problem using Binary Index Tree(BIT). We store all the indexes which are odd. Now, in-case we have to find all the odd numbers we can simply find the sum in the range. To find the even numbers we simply have to subtract all the odd numbers… Continue reading Hackerearth : Help Ashu