10

PROBLEM OF THE DAY: 05/10/2023 | Count number of substrings

 1 year ago
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-05102023-count-number-of-substrings/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

PROBLEM OF THE DAY: 05/10/2023

Hi everyone. I am current mushroom, welcome to this video.
October 06, 2023 |1.6K Views
PROBLEM OF THE DAY: 05/10/2023 | Count number of substrings
Problem of the Day, String, Data Structure and Algorithm
 Save  Share  3 Likes
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Strings but will also help you build up problem-solving skills.

In this problem, we are given, a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that have exactly k distinct characters.

Example :

Input:
S = "aba", K = 2
Output:
3

Explanation:
The substrings are: "ab", "ba" and "aba".

Give the problem a try before going through the video. All the best!!!

Problem Link: https://practice.geeksforgeeks.org/problems/count-number-of-substrings4528/1
Solution IDE LInk: https://ide.geeksforgeeks.org/online-cpp-compiler/201508fb-29c3-4e7c-a0ad-a19a3af16ccc

Read More

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK