- Write a function that:
- takes two arguments: an array of strings and an integer k
- returns k most frequent strings in the given array (in order of frequency).
For example, input of ['a', 'b', 'a', 'c', 'a', 'b'], k = 1 should return ['a']. Same array and k = 2 should return ['a', 'b'].
- Write an interface for a vending machine that has following functions:
- receive coins
- select item
- give out item
- give out change in coins
Part one: write a class with methods/fields declarations, don't implement the methods' bodies.
Part two: implement the method for giving out change.