Pergunta de entrevista da empresa Virtusa

Write the code for Subarray and it's sum and explain it