Комментарии:
Mam can you give me the solution in C language pls!
ОтветитьExcellent
ОтветитьHi , Could you please help me in understanding this question , because I have done this problem in other way , I am getting the desired result in IDE but in leetcode it is failing . Please have a look on below approach:
Set<Integer> set=Arrays.stream(nums).boxed().collect(Collectors.toCollection(LinkedHashSet::new));
int[] expectedNums=new int[set.size()];
int index=0;
for(int i:set){
expectedNums[index]=i;
index++;
}
System.out.println(Arrays.toString(expectedNums));
System.out.println(expectedNums.length);
I can return expectedNums.length at the end . But this solution is not accepted , why ?
Well presented
Ответить@6.42 Why the last element won't be the duplicate?
Ответитьcan u continue the series mam pls
ur approach is so good
nice explanation dude☺
Ответитьthanks mam
ОтветитьThank you mam
Ответитьmam pls continue this interview series thanks you mam🤩🤩🤩🤩
Ответить