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!!!
Sunday, January 14, 2018
[2018-Interview] Contains Duplicate
Original question: https://leetcode.com/problems/contains-duplicate/
Answer:
publicclassSolution{publicbooleancontainsDuplicate(int[] nums){// Hashset// or sort it first, compare element with next one }}
No comments:
Post a Comment