Next, we will write a code to shift all the vowels to the front and consonants to the back in the given string, without changing their order. This might seem quite tough at first, doesn't it? Give it a thought and try to think of an approach before we see Sajan break down this complex looking problem.
This goes to illustrate how a complex looking problem can be so easy beneath once we calmly break it down to smaller chunks and think about it in the right way.
Wasn't that really simple? Well, you'll soon be able to do it as you go ahead. Let's see how do we translate the above pseudocode in Python.
Can you try the problem now? Try to think what would have happened if you tried 'v = i + v' instead of 'v = v+ i'?
You just saw how easy it was once we broke down the problem and thought about it. This is what coding is all about, finding the right approach. Typing it on the keyboard is just trying to explain the process to the computer.
In the next segment, you will learn how to find a common prefix part in the two strings.