Skip to content

Instantly share code, notes, and snippets.

@johndavedecano
Created October 1, 2017 18:09
Show Gist options
  • Save johndavedecano/c1d8b55377fb96311536f4433fb6c9f1 to your computer and use it in GitHub Desktop.
Save johndavedecano/c1d8b55377fb96311536f4433fb6c9f1 to your computer and use it in GitHub Desktop.
EXAMS - DISTINCT VALUES
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 6.4.0)
return A.filter((x, y, z) => z.indexOf(x) === y).length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment