We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c1303d commit 4a2985fCopy full SHA for 4a2985f
2947-count-beautiful-substrings-i.js
@@ -0,0 +1,27 @@
1
+/**
2
+ * @param {string} s
3
+ * @param {number} k
4
+ * @return {number}
5
+ */
6
+var beautifulSubstrings = function(s, k) {
7
+ let counter=0;
8
+ for(let i=0;i<s.length;i++){
9
+ let vow=0;
10
+ let con=0;
11
+ for(let j=i;j<s.length;j++){
12
+ let c=s.charAt(j);
13
+ if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'){
14
+ vow++;
15
+ }
16
+ let df=j-i;
17
+ df++;
18
+ con=df;
19
+ con=con-vow;
20
+
21
+ if(vow==con &&(vow*con)%k==0){
22
+ counter++;
23
24
25
26
+ return counter;
27
+};
0 commit comments