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.. 🙏🙌
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 ??
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.
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.
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
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.. 🙏🙌
like target is 150. Please do like and comment if you have understood the explanation as well as the code.😄😄
great explanation
Good explanation bhaiya.
koi faltu ka drama nhi very good sir
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 ??
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.
@@shashwat_tiwari_st ohhh, I see.. Thank you..❤😇
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.
@@rajeevranjan9172 thanks rajeev... I have pinned the comment. Thanks a lot for pointing. Sorry for the confusion
sir make a video on how to approach DSA question . I am facing challenge to solve
Slightly tough
😍😍
Sir we can also use priorityQueue to solve this problem
Yes we can use..
what is the meaning of this Line in ques ??
You do not have to use all characters from s.
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