Given a string s we have to find the length of the longest substring of s which contain exactly K distinct vowels. This is the problem statment given on geeksforgeeks Input : s = “artyebui”, k = 2 Output : 6 The only solution present on geeksforgeeks is the dynamic programming one. Can someone help with the recursive solution?

  • 1
    $\begingroup$ What did you try? Where did you get stuck? It is expected of you to show your partial progress, thoughts or where you got stuck. This site is a knowledge-sharing question-and-answer place instead of a solution rendering service. $\endgroup$ – John L. Apr 15 '19 at 14:17
  • $\begingroup$ Hi.. I am new to this place. Will definitely take care next time. Can you please help me with the question? $\endgroup$ – Harvey Andrews Apr 15 '19 at 17:45
  • 1
    $\begingroup$ Please edit your post to add a reference to the article on GeeksforGeeks. $\endgroup$ – John L. Apr 15 '19 at 18:23
  • $\begingroup$ The brute force solution just tries all substrings. I'm not sure what a recursive solution would look like. $\endgroup$ – Yuval Filmus Apr 15 '19 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.