Problem 3026. Legend of Zelda - Rupee Count (Compact)

Building off of Problem 3025, suppose that Link's rupee wallet will now provide a compact string with one letter designating each rupee he's picked up. Once again, the rupee denominations are (with abbreviating characters):

  • Green (g) = 1
  • Blue (b) = 5
  • Yellow (y) = 10
  • Red (r) = 20
  • Purple (p) = 50
  • Orange (o) = 100
  • Silver (s) = 200
  • Big green (G) = 50
  • Big blue (B) = 100
  • Big red (R) = 200
  • Big gold (*) = 300

Note that the string will be case-sensitive. Write a function to return the total value of rupees that Link has accumulated provided the compact rupee string.

Solution Stats

76.62% Correct | 23.38% Incorrect
Last Solution submitted on Feb 22, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers55

Suggested Problems

More from this Author139

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!