Created
April 14, 2015 09:05
-
-
Save stephen-maina/3af89d13b29a2f65f34f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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