1935. Maximum Number of Words You Can Type |

1935.-maximum-number-of-words-you-can-type-|

Intuition

Given string some char broken they cant be used to make that word. return the miniumum number of words that we can form with this.

Approach

just check and reduce the count if the chars are found

Complexity

  • Time complexity:
  • O arr size and O borken letter size

  • Space complexity:

  • On for array

Code

“`cpp [] class Solution {
public:
int canBeTypedWords(string text, string brokenLetters) {

    // Hello world ad  
    stringstream ss(text);
    vector arr; 
    string word;    
    while(ss >> word){
        arr.push_back(word);
    }
    int ans = arr.size(); 
    for(string  s: arr){

        for(int i=0; i

};


Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
homevista-remodeler:-instantly-visualize-home-renovations-with-ai-design

HomeVista Remodeler: Instantly Visualize Home Renovations with AI Design

Next Post
q-the-future:-enterprise-productivity-with-aws-q-business

Q the Future: Enterprise Productivity with AWS Q Business

Related Posts