-1

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

Comments
  • 3
    Well, first of all you need to write an algorithm to figure out what data at which index is redundant.
  • 1
    Google/Bing/Yahoo/Yandex/DDG has the answer.
  • 2
    That's an interview question. We're more likely to help when you have a problem with some meat on it.
  • 1
    Compression? More efficient encoding?
  • 1
    In C#

    stringEnumerable.Distinct();
  • 0
    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
  • 5
  • 2
    Assuming it's all redundant:

    arr = null;

    Assuming it's not, more detail required. And an attempt at a solution.
  • 0
    @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']
  • 1
    > i'm an experienced JavaScript dev
    > how do you remove duplicates from an array

    yeah
  • 0
    @12bitfloat

    JavaScript has an inbuilt function for that.
  • 0
    @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
  • 0
    @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πŸ˜’
  • 0
    @molaram ok how much do you charge for an interview question?
  • 0
  • 0
    @12bitfloat ok but i solved mine

    Next time
  • 0
    @Afrographics Just let me know lol
  • 0
    @molaram 🀣🀣🀣🀣

    πŸƒπŸƒπŸƒ

    Let's just drop that then
Add Comment