+ 2
Help regarding c++ Mode program.
Here my code:(its working BUT Why arr[i] is always equal to arr[j] even if all the elements are unique) arr is a sorted vector containing all the numbers and "a" is the number of elements in vector. for example arr[10]=64630 11735 14216 99233 14470 4978 73429 38120 51135 67060 https://code.sololearn.com/cXkB2o1jOZ2l/?ref=app from line 28 to 49 Here question link: https://www.hackerrank.com/challenges/s10-basic-statistics/problem
4 Antworten
+ 1
so changing value at line 30 [j=j+1] (initially j=1) and at line 36 [==0] (initially ==1), made it work as should be
I am dumb sometime😛
+ 1
Edited
0
~swim~ Well i was checking the elements are unique or not, if not increase the value of arrTemp[i] by One
0
Please looks at code again and post unencrypted comment