wes d2a2ba9e15 first commit | преди 4 години | |
---|---|---|
.. | ||
README.md | преди 4 години | |
code.cpp | преди 4 години | |
unitTest.cpp | преди 4 години |
by Alex Golubov tags: arrays, strings, validation
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"
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).
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"}
Tests are case sensitive.