Problem 9. Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies that person has (in that order). What is the row index of the person with the most money?
Note for those unfamiliar with American coins: quarter = $0.25, dime = $0.10, nickel = $0.05, penny = $0.01.
Example:
Input a = [1 0 0 0; 0 1 0 0] Output b = 1
since the first person will have $0.25 and the second person will have only $0.05.
Solution Stats
Problem Comments
-
62 Comments
I have tagged this problem as stupid. I encourage others to do the same. This is a place to learn, not to ask trick questions.
@Brandon, what makes you think one can not learn from trick questions?
If nothing else one can learn to read a task's description carefully before starting to write code, which I would argue is fairly important when doing any kind of programming.
Solution Comments
Show commentsProblem Recent Solvers8970
Suggested Problems
-
2332 Solvers
-
17188 Solvers
-
Project Euler: Problem 7, Nth prime
1565 Solvers
-
689 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
1975 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!