Java Streams Interview Question - 06 - Print Duplicate Numbers using Streams

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • Java Streams Interview Question - 06 - Print Duplicate Numbers using Streams
    Schedule a meeting in case of any queries/guidance/counselling:
    calendly.com/n...
    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    www.youtube.co...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
    t.me/joinchat/...
    Naveen AutomationLabs Paid Courses:
    GIT Hub Course:
    naveenautomati...
    Java & Selenium:
    naveenautomati...
    Java & API +POSTMAN + RestAssured + HttpClient:
    naveenautomati...

КОМЕНТАРІ • 19

  • @amritapriyadarshini511
    @amritapriyadarshini511 2 роки тому +1

    Thanks Naveen...One of my friend suggested me..to watch your videos which is so helpful for me.I got job.todY as automation engineer..thank you so much.

  • @vanishreeism
    @vanishreeism Рік тому +3

    Actual filtering is happening due to the feature of set and due to Collections.frequency operation. To prove this try collecting it to a list instead of set

  • @priyaranjan1973
    @priyaranjan1973 Рік тому +3

    Set all=l.stream().filter(
    n-> l.stream().filter(x->x==n).count()>1
    ).collect(Collectors.toSet());

  • @mohammedsufi4649
    @mohammedsufi4649 9 місяців тому

    Thank you so much for the video. Very useful. Please keep it up

  • @deepanshurathore9661
    @deepanshurathore9661 2 роки тому +2

    I think Set method is optimised take O(n) time . freq method might be take O(n2) time

  • @AnilSharma-fb3ze
    @AnilSharma-fb3ze 2 роки тому

    Thank you Naveen, it is greatful to use Streams

  • @muthikinaveen2195
    @muthikinaveen2195 Рік тому +1

    Can you please explain using stream how find out highest occurrence number in array

  • @MyScreenSpectrum
    @MyScreenSpectrum 2 роки тому

    Thanks Naveen. It's very helpful

  • @vengateshm2122
    @vengateshm2122 2 роки тому +1

    Very useful. Thank you.

  • @smsms8522
    @smsms8522 Рік тому +1

    We have distinct functionality in streams. numbers.stream().distinct();

  • @arunsinghrajpoot5363
    @arunsinghrajpoot5363 Рік тому +1

    Thanks bro

  • @ankarigaripriyanka8306
    @ankarigaripriyanka8306 2 роки тому +2

    never heard we could do it this way also

  • @sanoopk8847
    @sanoopk8847 2 роки тому

    Waiting for more videos

  • @mastermind6269
    @mastermind6269 4 місяці тому

    second solution would not work if we have accourence more than two times, we have to use distinct() method there!

  • @karamjitsinghsehdev3451
    @karamjitsinghsehdev3451 2 роки тому

    How to get duplicates with their counts and return map?

  • @madarauchiha-dr5ws
    @madarauchiha-dr5ws Рік тому

    No need to use collectors.toset(), collectors.toList() will work. Can someone please correct me if I am wrong

    • @ruishizhang1159
      @ruishizhang1159 9 місяців тому

      List won't work if there is a tripled number