Data Structures, Algorithms, Leetcode, Segment Tree, Programming.
Bitset We know that for interval query problems, segment tree is an expert in handling them(If you are not familiar with segment trees, you can take a look at Segment Tree 1: Basic Concepts and Operations in Detail), such as interval maximum, sum, etc. Moreover, this problem has a feature that the