WCC '25 P2 - Home Alone
St. Robert CHS Annual Winter Coding Contest: Problem 2
Harry Lyme and Marv Munchins are robbing houses for Christmas! They've classified the homes on their street into three types: small, worth \($10\), medium, worth \($100\), and large, worth \($1000\). There is also a special house on the street inhabited by Kevin McCallister, which will reduce the robbers' balance to $0 and end their run.
Unfortunately, they spent too long coming up with this system and forgot to learn addition! As such, they need your help to determine how much money they will make from their adventures.

Image: Home Alone (1990)
Input Specification
A string containing the houses that will be robbed, such that \(S\) represents a small house, \(M\) represents a medium house, \(L\) represents a large house and \(X\) represents Kevin McCallister's house.
Output Specification
A single non-negative integer, \(P\), the profit made by the robbers.
It is guaranteed that the \(P\) fits inside a \(32\)-bit integer.
Sample Input
SSLSM
Sample Output
1130
Explanation of Sample Output
The total profit is $10 + $10 + $1000 + $10 + $100 = $1130
Comments