Leyton Interview Question

Case exercice abt java & scala