Leetcode Range Sum Query Codeforces Solution