2182. Construct String With Repeat Limit | leetcode daily challenge | shashcode30

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 17

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  Місяць тому +2

    Little correction:
    I misunderstood the last paragraph.
    Just to clarify:
    1. We compare characters first.
    2. If all characters are same then we take the string whose length is larger.
    1:45, I mentioned that first we check length and then compare characters. Sorry about the confusion and thanks for correcting me.. 🙏🙌

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  Місяць тому +3

    like target is 150. Please do like and comment if you have understood the explanation as well as the code.😄😄

  • @palakbiswas1814
    @palakbiswas1814 Місяць тому

    great explanation

  • @aakashdeep_2310
    @aakashdeep_2310 Місяць тому

    Good explanation bhaiya.

  • @AkshitSingh-o9u
    @AkshitSingh-o9u Місяць тому

    koi faltu ka drama nhi very good sir

  • @tejas2636
    @tejas2636 Місяць тому

    What will be the output of "aaaaaz"
    If Output = "zaaa" , so the length of output is less than input and it's lexicographically smaller as per question (As mentioned in video at timestamp : 1:20) .. What will be the possible answer ??

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      answer will be zaaa. It is mentioned in question that you don't have to include all characters. Just return the lexicographically largest string that can be formed.
      We don't have to create a string which is lexicographically greater than input..
      Using input we have to generate largest lexicographical string.

    • @tejas2636
      @tejas2636 Місяць тому

      ​@@shashwat_tiwari_st ohhh, I see.. Thank you..❤😇

  • @rajeevranjan9172
    @rajeevranjan9172 Місяць тому

    Sir at 1:45 you said that "abcd" is lexicographically larger than "za"(just because the length of the string "abcd" is larger than "za").
    can you recheck the video at the time stamp 1:45.

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      ​@@rajeevranjan9172 thanks rajeev... I have pinned the comment. Thanks a lot for pointing. Sorry for the confusion

  • @All-in-one85696
    @All-in-one85696 Місяць тому

    sir make a video on how to approach DSA question . I am facing challenge to solve

  • @DarkDragon-bz6qp
    @DarkDragon-bz6qp Місяць тому +1

    Slightly tough

  • @PiyushSharma-we8yd
    @PiyushSharma-we8yd Місяць тому +1

    😍😍

  • @AshishVermaO2O3O3
    @AshishVermaO2O3O3 Місяць тому

    Sir we can also use priorityQueue to solve this problem

  • @RecievedMail
    @RecievedMail Місяць тому

    what is the meaning of this Line in ques ??
    You do not have to use all characters from s.

    • @thAsciNileshPal
      @thAsciNileshPal Місяць тому

      Means we have to generate lexographucally largest string but it should be smaller than the given input..means considering the input we have to generate lexographucally largest string