Day - 100

Day - 100

Assalamu alaykum, everyone!


And finally, today is the last day of my 100-day challenge. Getting to this day has not been easy. I am writing today's post in a different mood. Maybe because this is my first challenge in this direction, it is not surprising that such emotions are passing! But it is difficult to describe. The past 100 days have been amazing. Many things have changed in my life. I can even say that some nights passed without sleep. In the intervening days, I thought a lot about how to finish this challenge. The questions of what would happen if I didn't finish on time were troubling, but I managed to do it. And I am very happy to share it with you. One thing I've realized these days is that time flies so fast. Spend your free time on something worthwhile rather than on useless things. I hope it will be beneficial not only for you today but also for your future. I am sure of it.


So we will end today's challenge with a solution to a problem. Are you ready?


  1. Problem 2586. Count the Number of Vowel Strings in the Range

Time Complexity:

The time complexity of the code is O(n), where n is the number of words in the array. This is because the for loop iterates over the entire array, and each iteration takes a constant amount of time.

Space Complexity:

The space complexity of the code is O(1) since the only additional space that is used is the constant space required to store the vowels string and the count variable.

Code:

/*
?* @param {string[]} words
?* @param {number} left
?* @param {number} right
?* @return {number}
?*/

var vowelStrings = function (words, left, right) {
? let count = 0;
? const vowels = "aeiou";

? for (let i = left; i <= right; i++) {
? ? const str = words[i];
? ? const firstChar = str.at(0);
? ? const lastChar = str.at(-1);

? ? if (vowels.includes(firstChar) && vowels.includes(lastChar)) count++;
? }

? return count;
};        



#coding #challenges #leetcode #javascript #programming #problems #solutions #100daysofcodechallenge #finish #like #share

要查看或添加评论,请登录

Abbosbek Sulaymonov的更多文章

  • Polyfills in JavaScript

    Polyfills in JavaScript

    Assalamu alaykum, everyone! I haven't been able to write anything for a long time. I hope you will forgive me for this.

  • Day - 99

    Day - 99

    Assalamu alaykum, everyone! How are you guys? It is the 99th day of my coding challenge! So, I am going to post a good…

    1 条评论
  • Day - 98

    Day - 98

    Assalamu alaykum, everyone! It is time to share the 98th day of my coding challenge! These days, I am solving problems…

  • Day - 97

    Day - 97

    Assalomu alaykum, everyone! It is the 97th day! I am glad to see you here! Today I am going to show a solution for…

    1 条评论
  • Day - 96

    Day - 96

    Assalamu alaykum, everyone! It is the 96th day of my coding challenge! We passed 96 days ). It is a great result! I…

  • Day - 95

    Day - 95

    Assalamu alaykum, everyone! Today, I am going to share the 95th day of my coding challenge! So, let's start the coding!…

  • Day - 94

    Day - 94

    Assalamu alaykum, everyone! It is the 94th day of my coding challenge! I do not know how to describe my thoughts! So…

  • Day - 93

    Day - 93

    Assalomu alaykum, everyone! I am glad to see you here! It is the 93rd day of my coding challenge! So, let's start the…

  • Day - 92

    Day - 92

    Assalamu alaykum, everyone! Day by day I see these actions are giving the result! It is the 92nd day of my coding…

  • Day - 91

    Day - 91

    Assalamu alaykum, everyone! As usual, I am going to share a day as well! Today we are going to solve a problem on…

社区洞察

其他会员也浏览了