CodeMosa
Master LeetCode Patterns
All Patterns
Collections
Sign In
Back
Prefix/Suffix Arrays
Question 1 of 12
8% Complete
Easy
What is the main advantage of using prefix sums?
A
Answer range sum queries in O(1) after O(n) preprocessing
B
Sort the array faster
C
Find the maximum element quickly
D
Reduce space complexity
Need a hint?
Think about query time complexity