Answer:
public class Solution { public boolean containsDuplicate(int[] nums) { // Hashset // or sort it first, compare element with next one } }
Hello, welcome to Yizhe's Blog. I am Yizhe Liu, graduated from University of Arizona, with Master degree, major in Electrical and Computer Engineering. Actually, I am software guy. In my blog, many posts are about the Leetcode questions. I will post my ideas and implementations, which are accepted by Leetcode. If you have different opinions, please leave comment. I am happy to discuss with you. So lets start rocking them!!!
public class Solution { public boolean containsDuplicate(int[] nums) { // Hashset // or sort it first, compare element with next one } }
No comments:
Post a Comment