BackmediumStrings Atlassian

Count Unique Substrings of Length 7 Solution

Problem Statement

Given a string sequence, find the total count of distinct substrings of length exactly 7.

Example 1
Input
abcdefgh
Output
0

Explanation: Step-by-step: Given the input string 'abcdefgh', we check its length. Since it's 8, which is greater than 7, we return 0 because there are no substrings of length 7.

Example 2
Input
abcdefghi
Output
0

Explanation: Step-by-step: Given the input string 'abcdefghi', we check its length. Since it's 9, which is greater than 7, we return 0 because there are no substrings of length 7.

Constraints

  • 1 <= sequence length <= 10^5
  • The input string consists of lowercase English letters only.
  • The length of the substring is fixed at 7.
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free