Yet Another Profit Problem
CodeChefOpen on judge ↗
Cooper is a shopkeeper with a list of items. Any item in the list is a number from 0 to 9 inclusive. A string $S$ represents the list of items in which the $i$-th element is given by $S_i$. You are given two arrays $A$ and $B$ of size $10$ such that the cost price of an item $i$ is denoted by $A_i$ whereas the selling price of an item $i$ is denoted by $B_i$. For example, cost price of an item '3'
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.
Sign in to chat with the tutor and save your progress.
Sign in to start