wes d2a2ba9e15 first commit 4 年 前
..
README.md d2a2ba9e15 first commit 4 年 前
code.cpp d2a2ba9e15 first commit 4 年 前
unitTest.cpp d2a2ba9e15 first commit 4 年 前

README.md

Remove Duplicates from an Array

by Alex Golubov tags: arrays, strings, validation

Summary

Create a function that takes an array of items, removes all duplicate items and returns a new array in the same sequential order as the old array (minus duplicates). Examples removeDups({"The", "big", "cat"}) ➞ {"The", "big", "cat"} removeDups({"John", "Taylor", "John"}) ➞ {"John", "Taylor"} removeDups({"javascript", "python", "python", "ruby", "javascript"

Instructions

Create a function that takes an array of items, removes all duplicate items and returns a new array in the same sequential order as the old array (minus duplicates).

Examples

removeDups({"The", "big", "cat"}) ➞ {"The", "big", "cat"}

removeDups({"John", "Taylor", "John"}) ➞ {"John", "Taylor"}

removeDups({"javascript", "python", "python", "ruby", "javascript", "c", "ruby"}) ➞ {"javascript", "python", "ruby", "c"}

Notes

Tests are case sensitive.