Skip to content

Instantly share code, notes, and snippets.

@stephen-maina
Created April 14, 2015 09:05
Show Gist options
  • Save stephen-maina/3af89d13b29a2f65f34f to your computer and use it in GitHub Desktop.
Save stephen-maina/3af89d13b29a2f65f34f to your computer and use it in GitHub Desktop.
import java.util.stream.IntStream;
import java.util.Set;
import java.util.stream.Collectors;
class Solution {
public int solution(int[] A) {
// write your code in Java SE 8
Set<Integer> result=IntStream.of(A).boxed().collect(Collectors.toSet());
return result.size();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment