a random list of 1000 numbers. Each one in the range of 1-10.
You need to detect how many time each number is set.
WITHOUT counters..
Can someone help me?
Launch a new program every time you see a repeating number
Sort in vector Find last value Return IndexEnd-IndexStart Begin 1 4 2 1 1 5 5 3 Sort 1 1 1 2 3 4 5 5 Find last 1 1 1 1 2 3 4 5 5 ^ IndexLast = 2 IndexStart = 0; Count = IndexLast-IndexStart+1;
Обсуждают сегодня