java(13ms),easily solution about using Set.


  • 0

    if(nums.length<=0) return false;
    Set<Integer> st=new HashSet<Integer>();
    for(int a:nums)
    st.add(a);
    if(st.size()<nums.length)
    return true;
    return false;
    '''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.