Solution:Segment Tree or Binary Indexed Tree 思路: Time Complexity: O(N) Space Complexity: O(N) Solution Code: