Student Beans Interview Question

How to solve a coding challenge