Halloween Sale
Unlock all premium questions for over 30% off
Maximize Assigned Negative Signs
Easy
Question
You are given a sequence of n natural numbers a_1, a_2, ..., a_n, passed as the array arr. Put a sign, either "+" or "-", in front of every a_i so that each running total of the signed values, a_1 + a_2 + ... + a_i, stays strictly positive for every i with 1 <= i <= n. Under that requirement, make the number of "-" signs as large as possible and return that number.
...
Asked at:Amazon
More Amazon interview questions
- Count Distinct Password Variantseasy
- Get Daily Total Requestsmedium
- Find Minimum Reverse Operationsmedium
- Simplified Regex Pattern Matchinghard
- Count Idle Driveseasy
- Test Array Generation Serviceeasy
- Maximum Balanced Shipment Countmedium
- Detect Obfuscated Abusive Wordshard
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.