Permutations of a String - Iterative Solution | String and Stringbuilders in JAVA

preview_player
Показать описание

NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the Permutations of a String problem with an iterative solution using the concepts of strings and stringbuilder. In this problem,

1. You are given a string.
2. You have to print all permutations of the given string iteratively.

Рекомендации по теме
Комментарии
Автор

The logic was out of the world. Thank you !!

sanbidrc
Автор

The solution was out of the mind but after seeing the video CLICKED..
Thank you for your efforts sir !!!!

nidhipal
Автор

this logic is very complex in the beginning itself

rohandevaki
Автор

sir i m eager to start your level 2 intermediate. lots os love sir

harshitkaushik
Автор

This approach is new and osm but only for distinct characters not for strings like aab, abba

amanbhatt
Автор

sir can we do same logic for integer values

harishkunwar
Автор

will it work for string having similar letters like 'aab', 'abcb'? I think so it will fail at such test cases

nitinchatwani
Автор

yeh trick sochi kese ?? kya koi or brute force method nahin hain isse iteratively solve krne ka ??

prateekbansal
Автор

If there are repeating characters in input string like "ABA", it will generate duplicates which someone from comments section has already pointed out. What I do is instead of printing the character to console, I append it to one more StringBuilder and after inner loop exits, I add that permutation to a set - New StringBuilder per outer loop iteration. Works but not sure if it is the efficient way to handle duplicates .

as_wani
Автор

how did you came up with this approach??

sourabhyogi
Автор

Sir agar string ka length 12 se bda hua to factorial ke large value ki vajah se integer overflow ho jayega

codebits
Автор

sir pepcoding site pe direct answer video hi show ho rha h string ke question me!

arex-gaming
Автор

sir aisa ho kaise gya?? trick ko samjh mei ayi... matlab apki language mei bole to how samjh mei aya but why nhi?? =^D .and again.. thanks a lot sir...

prakharagarwal
Автор

You are a mathematical scientist declared by your youtube student who will be become a great Scientists.

vishalit
Автор

Sir which software you use for drawing.
It is good for us to visualize or draw problem and algorithms before coding
Please tell us the name of software🙏🏻🙏🏻

_-_.
Автор

Sir, agar yeh situation hoh pehle A waale permutation, fr B waale permutation, fr C waalw permutation in ABC toh fr kya krenge? Kaise hoga?

dhruvtrehan
Автор

Sir pepcoding t-shirt mei ak lena chata hon. Kaise milega...?

indranilchakraborty
Автор

Sir what is the name of this algorithm? I didn't understand why this works ??

harshit
Автор

Sir kitne dino me click kiya ye algo aapko?? 🙇‍♂️🙇‍♂️

rohitmeena
Автор

the next permutaion of abc should be acd not bac . it was printing all the permutationns but not in order

sainathreddy