+ 1
Please, how can we remove duplicate numbers in a file without using array?
note that getline cannot we used for numbers
1 Resposta
+ 1
using array is the best way.
but if you Don't want to use array than here is another way.
store the first number in any variable than compare it with all other numbers using loop. if match found than remove it.
you have to repeat this for all numbers.
NOTE!!!!
this solution is not recommended...
because here we need nested Loop so time complexity is n^2.