Given an array, remove any duplicated elements and return a new array.
Sample Code:
function onlyOne(arr) {
// Enter your logic here...
}
Examples:
Input: ['C','Javascript','Java','Python','Javascript']
Output: ['C','Javascript','Java','Python']
Explanation: The number of occurence can only be 1 for each elements.
Input: [0,0,1,1,0]
Output: [0,1]
Explanation: The number of occurence can only be 1 for each elements.