Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Well, first of all you need to write an algorithm to figure out what data at which index is redundant.
-
That's an interview question. We're more likely to help when you have a problem with some meat on it.
-
Function remove_duplicates(list)
arr = Split(list,",")
Set dict = CreateObject("Scripting.Dictionary")
For i = 0 To UBound(arr)
If dict.Exists(arr(i)) = False Then
dict.Add arr(i),""
End If
Next
For Each key In dict.Keys
tmp = tmp & key & ","
Next
remove_duplicates = Left(tmp,Len(tmp)-1)
End Function -
Assuming it's all redundant:
arr = null;
Assuming it's not, more detail required. And an attempt at a solution. -
@AlmondSauce it's as if you didn't get the thing
here is an example
If you have a table with redundant item like this
T = ['cc','aa','ab','aa','cc'];
The output need to be like this
O = ['cc','aa','ab'] -
> i'm an experienced JavaScript dev
> how do you remove duplicates from an array
yeah -
@Afrographics I just think it's funny how you say you are an experienced dev when you have problems writing your own deduplication function. A performant one may be harder but a simple one is literally just a hashset lookup
-
@12bitfloat it's just a waste of time for me to re-invent the wheel.
in C/C++. I didn't find an in-built function for that.
So that is i wanted to code it. Myself. And i have already found the solution
Aloneπ
I don't know if people solve coding problem here too .
Please i need an algorithm to remove redundant data inside an array of string
random