A solution in scala for Activity Selection Problem