How to find duplicates in an array and remove them
efficiently?

Answer Posted / crazy boy

**How to find duplicates in an array and remove them efficiently?
=================================================
dim a(4)
a(0)=10
a(1)=20
a(2)=10
a(3)=20
a(4)=50

for i=0 to ubound(a)
for j=i+1 to ubound(a)
if a(i)=a(j) then
a(i) =empty
end if
next
next

for i=0 to ubound(a)
if a(i)<>"" then
msgbox a(i)
end if
next

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain keyword driven framework with banking domain?

1567


Which scripting language used by quicktest professional?

542


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

599


i have asked earlier only one question how to test web application using QTp plz send me the answer quickly

1662


How to use conditional loops in qtp ?

597






How to use setroproperty?

581


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1439


Plz Explain AUTOMATION REFERENCE MODEL?

1686


How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?

3448


hi, can u tell me the QTP TEsting process in present real time companies?(beware of this... now a days Recording is not using,, only DP) and don't tell note book answers like step 1 spep2....like this .......post answer with professional skills in simple english words) thank u

1340


How to customize checkpoints with parameters?

3029


I want to open a Notepad window without recording a test and I do not want to use System utility Run command as well. How do I do this?

623


How to add verification steps to tests?

9134


explain structured testing? plz guys with exp. do answer

1416


In qtp, explain what is keyword driven automation framework?

624