← All practice quizzes🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?24 students have taken today’s challengeTake today’s challenge →
Quiz: Prefix Sums and Difference Arrays
5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass
Answer "sum of a[l..r]" in O(1) after one pass, count subarrays with a given sum using prefix sums plus a hash map, and add a value to whole ranges in O(1) with a difference array.
Log in to take the quiz
Free account · see your score, answers and explanations, earn XP