Swift Comparison in consecutive numbers inside array and its count