Added task 24 scala solution