This is a problem of Hackerrank Problem Solving basic certification Link.
Given a string S of lowercase English letters and an integer of the substring length K, determine the substring of that length that contains the most vowels. Vowels are in the set (a,e,i,o,u). If there is more than one substring with the maximum number of vowels, return the one that starts at the lowest index. If there are no vowels in the input string, return -1.
1<= Stringlength <=2*10^5
1<= K <=String length
Answer- erqii as it contains 3 vowels
My approach was to basically bruteforce approach, how can I optimise it?