Logo

dev-resources.site

for different kinds of informations.

count-of-substrings-containing-every-vowel-and-k-consonants-i

Published at
9/29/2024
Categories
map
leetcode
contest
java
Author
prashantrmishra
Categories
4 categories in total
map
open
leetcode
open
contest
open
java
open
Author
15 person written this
prashantrmishra
open
count-of-substrings-containing-every-vowel-and-k-consonants-i

Problem

class Solution {
    public int countOfSubstrings(String word, int k) {
        int count = 0;
        for(int i =0;i<word.length();i++){
            HashMap<Character,Integer> map = new HashMap<>();
            int consonent = 0;
            for(int j = i;j<word.length();j++){
                char c = word.charAt(j);
                if(c =='a' || c =='e' || c=='i' || c =='o' || c =='u'){
                    map.put(c,map.getOrDefault(c,0)+1);
                }
                else consonent++;
                if(map.size() ==5 && consonent ==k)count++;
            }


        }
        return count;
    }
}
Enter fullscreen mode Exit fullscreen mode
map Article's
30 articles in total
Favicon
Nextjs + Openlayers integration
Favicon
🌟 Join mamap.io early and get 50% off! 🌟
Favicon
How to Fetch and Integrate Multiple Location API Data into Google Maps in WordPress Without Plugins
Favicon
How can I integrate Leaflet to React Native
Favicon
Мапа для дебага
Favicon
5 Useful GIS shapefile map tools
Favicon
5 Free GIS Software Options: Map the World
Favicon
Java’s TreeMap.tailMap() Method Explained
Favicon
💻C# Masofani Topish
Favicon
A Deep Dive into Java Maps: The Ultimate Guide for All Developers
Favicon
Understanding ES6 API's
Favicon
What is MAP Monitoring and How It Can Enhance Your Brand’s Reputation
Favicon
Building a Location-Based Grocery App: Need advice on geo location
Favicon
[Apache Superset] Topic #4, Integrate 2D/3D maps into Superset
Favicon
count-of-substrings-containing-every-vowel-and-k-consonants-i
Favicon
Counting things in Javascript
Favicon
Difference between map, flatMap, compactMap
Favicon
Filtering and Mapping in JavaScript
Favicon
Map in JS
Favicon
Sveaflet - A newly Leaflet Library for Svelte
Favicon
The JS map() method
Favicon
Análise dos reservatórios federais - parte 1
Favicon
Getting started with Openlayers in React
Favicon
Reciprocity, Companion Planting & DevSecOps
Favicon
Finding Your Way With .Map()
Favicon
The Importance of Keys in Mapping an Array of Objects in React
Favicon
How to use Python's map() function to save time and effort in your code
Favicon
C++, about map, set
Favicon
Picomap - the smallest JS web map
Favicon
Scrape Google Maps data and reviews using Python

Featured ones: