To read and separate every number in its corresponding group, we will use
for loop froom 0 to
n (count of numbers). Every iteration of the loop will read and separate one single number (
currentNumber) in its corresponding group. In order to determine if a number belongs to a group, we perform a check in its respective range. If it is - we increase the count of the numbers in the corresponding group (
cntP2 etc.) with 1.