← All problemsSign in

Surya Imports and Exports

Surya runs a company of Imports and Exports.At the end of every month he checks the profit or loss of that month.Help Surya to find the number of months in which his profit is maximum. You are given a string $S$ of length of $N$ where each character is either 'P'(profit) or 'L'(loss) and an array $A$ of length $N$ which contains the corresponding amount of profit or loss of that month respectivel

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start