r/DsaJavaSpringboot • u/DeveloperOk • Jun 22 '25
Leetcode problem
we will discuss and practice about this topic be prepared for it :
https://leetcode.com/problems/contains-duplicate/description/
2
u/Glad-Skirt-2261 Jun 23 '25
Most optimization will be heir and turtle approach
1
u/DeveloperOk Jun 23 '25
please join today leetcode session at 9:15 pm IST timezone . we will learn and practice together today
1
2
u/Key_Marionberry_1227 Jun 26 '25
Can we just sort and find the same consecutive numbers
1
2
u/Jinkaza772 Jun 30 '25
Xor operation would work or not in this problem ?
1
u/DeveloperOk Jun 30 '25
please join discord today at 9:15 IST time (india time) we will discuss all about your doubt there
7
u/beingonredditt Jun 23 '25
class Solution {
public boolean containsDuplicate(int[] nums) {
HashSet<Integer> set = new HashSet<>();
for(int num:nums){
if(set.contains(num)) return true;
set.add(num);
}
return false;
}
}2
2
2
u/No_Teach1022 Jun 22 '25
when give exact time please