Starting point for coins problem in scala