Well, I have to find how many different numbers are in an array.
For example if array is: 1 9 4 5 8 3 1 3 5
The output should be 6, because 1,9,4,5,8,3 are uniqu
I think the location for increasing the value of r is incorrect
#include using namespace std; int main() { int r=0,a[50],n; cin >>n; for(int i=0;i> a[i]; } for (int j=0;j
However, my suggestion is using more sophisticated algorithms (this algorithm has O(N^2)).