I have no idea how to write program to find repeated number in the given sequence

Numbers[ ] = [ 6, 4, 2, 1, 3, 1 ]

Program output : Number 1 repeats 2 times

My attempt to make algorithm

Numbers[ ] = [ 6, 4, 2, 1, 3, 1 ]

is 6 == 4 ? if yes then 6 is repeated and if no then look for next element

is 6 == 2? if yes then 6 is repeated and if no then look for next element

is 6 == 1? if yes then 6 is repeated and if no then look for next element

is 6 == 3? if yes then 6 is repeated and if no then look for next element

is 6 == 1? if yes then 6 is repeated and if no then look for next element


is 4 == 2? if yes then 4 is repeated and if no then look for next element

is 4 == 1? if yes then 4 is repeated and if no then look for next element

is 4 == 3? if yes then 4 is repeated and if no then look for next element

is 4 == 1? if yes then 4 is repeated and if no then look for next element

is 2 == 1? if yes then 2 is repeated and if no then look for next element

is 2 == 3? if yes then 2 is repeated and if no then look for next element

is 2 == 1? if yes then 2 is repeated and if no then look for next element



is 1 == 3? if yes then 1 is repeated and if no then look for next element
is 1 == 1? if yes then 1 is repeated and if no then look for next element

is 3 == 1? if yes then 3 is repeated and if no then stop