Created
April 13, 2021 14:14
-
-
Save Nkwachi-N/6f40d194e35c649ae3af1ff8064b495f to your computer and use it in GitHub Desktop.
Remove Duplicate Elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int removeDuplicateElements(List array){ | |
List newArray = []; | |
for(var element in array) { | |
if(!newArray.contains(element)) { | |
newArray.add(element); | |
} | |
} | |
return newArray.length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment