Pergunta de entrevista da empresa UBS

Java logic problem related to sum of l the number coming in a perticular range.