LeetCode 1100, Medium. Topics: Hash Table, String, Sliding Window. View on LeetCode.
Generate this problem as a practice environment: tested reference solution, 12 parametrized pytest cases, and a playground notebook:
Problem
Given a string s and an integer k, return the number of substrings in s of length k with no repeated characters.
Examples
Constraints
- 1 <= s.length <= 10^4
- s consists of lowercase English letters.
- 1 <= k <= 10^4
Solution
Reference implementation from solution.py on GitHub, full suite in test_solution.py:
Complexity
NeetCode All. Last modified on September 7, 2026