Adding scala solution