Dsa
Prefix Sum
Easy
Product Sales Increases
You are given a list of product sales increases (positive and negative values) for a month. Write a program that takes as input the number of sales records, followed by the sales changes. Calculate and return the total sales after accounting for all the changes. If total sales is positive, print it, otherwise print 'No Sales'.
Example Input:
4
200
-50
-100
100
Example Output:
No Sales
Key concepts
prefix_sumarraycumulative_sum
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now