• + 0 comments

    hello coding lover,

    I have uploaded a tutorial on this problem which can solve this problem in O(N+Q) time.

    I hope this comment will help you to optimize your solution.

    https://www.hackerrank.com/challenges/sparse-arrays/forum/comments/598644