Combinations of max vowels in first half of the word

368 Views Asked by At

I am trying to find the max combinations of ways in which a word can be rotated and maximum vowels are present in the first half of the string.

Eg GHIJ has 2 combinations IJGH and HIJG.

Similarly, another example. abecde All possible combinations are : abecde eabecd deabec cdeabe ecdeab becdea Relevant combinations: abecde eabecd deabec Max vowel count in the first half is 2. Hence the result should be 3

Any idea how I can achieve this?