Find First Repeated and Non Repeated Character in a String Using Java8

Поділитися
Вставка
  • Опубліковано 2 жов 2024

КОМЕНТАРІ • 6

  • @PriyaSingh-w2f
    @PriyaSingh-w2f 10 місяців тому +3

    If u would have explained the code that will be very helpful, you are just writing the code

  • @vipintekade6400
    @vipintekade6400 Рік тому +7

    Confusing code 😞.

  • @ippevenkataswamy764
    @ippevenkataswamy764 Рік тому

    String input = "Hello Welcome"; can you try the input for above program its giving first repeated character coming wrong

    • @rushikeshpanchal1349
      @rushikeshpanchal1349 8 місяців тому

      getting correct output 'e' is first repetitive character .... Optional firstRepeatChar = charCount.entrySet().stream().filter((e->e.getValue()>1)).map(e->e.getKey()).findFirst();
      System.out.println("first repeat char: "+firstRepeatChar.orElse(null)); // e= first repeated character

  • @karnakarkanna3096
    @karnakarkanna3096 Рік тому

    bro If had exam can I drop a message for you