Super Market Problem Solution In Ruby