Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A comprehensive collection of coding challenges from multiple platforms for lear

| Platform | Focus Area | Problems Solved |
| ------------------------------- | ---------------------------- | --------------- |
| [LeetCode](#leetcode) | Data Structures & Algorithms | 172 |
| [LeetCode](#leetcode) | Data Structures & Algorithms | 173 |
| [GreatFrontEnd](#greatfrontend) | Frontend Engineering | 15 |

## Platforms
Expand Down Expand Up @@ -226,6 +226,7 @@ Various places where I enjoy practicing solving coding challenges:
- [0616 - Add Bold Tag in String](./leetcode/medium/0616-add-bold-tag-in-string) ![Medium](https://img.shields.io/badge/Medium-orange)
- [0692 - Top K Frequent Words](./leetcode/medium/0692-top-k-frequent-words) ![Medium](https://img.shields.io/badge/Medium-orange)
- [0760 - Bold Words in String](./leetcode/medium/0760-bold-words-in-string) ![Medium](https://img.shields.io/badge/Medium-orange)
- [1084 - Find K-Length Substrings With No Repeated Characters](./leetcode/medium/1084-find-k-length-substrings-with-no-repeated-characters) ![Medium](https://img.shields.io/badge/Medium-orange)
- [2487 - Optimal Partition of String](./leetcode/medium/2487-optimal-partition-of-string) ![Medium](https://img.shields.io/badge/Medium-orange)

### Binary & Bit Manipulation
Expand Down Expand Up @@ -333,6 +334,7 @@ Various places where I enjoy practicing solving coding challenges:
- [0159 - Longest Substring with At Most Two Distinct Characters](./leetcode/medium/0159-longest-substring-with-at-most-two-distinct-characters) - Medium
- [0209 - Minimum Size Subarray Sum](./leetcode/medium/0209-minimum-size-subarray-sum) - Medium
- [0340 - Longest Substring with At Most K Distinct Characters](./leetcode/medium/0340-longest-substring-with-at-most-k-distinct-characters) - Medium
- [1084 - Find K-Length Substrings With No Repeated Characters](./leetcode/medium/1084-find-k-length-substrings-with-no-repeated-characters) - Medium
- [More in docs →](./docs/techniques/SLIDING_WINDOW.md)

### Hash Table / Hash Map
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# [Find K-Length Substrings With No Repeated Characters](https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters) ![Shield](https://img.shields.io/badge/Medium-orange)

Given a string `s` and an integer `k`,
return _the number of substrings in_ `s` _of length_ `k` _with no repeated characters_.

**Example 1:**

```bash
Input: s = "havefunonleetcode", k = 5
Output: 6
Explanation: There are 6 substrings they are: 'havef','avefu','vefun','efuno','etcod','tcode'.
```

**Example 2:**

```bash
Input: s = "home", k = 5
Output: 0
Explanation: Notice k can be larger than the length of s. In this case, it is not possible to find any substring.
```

**Constraints:**

- `1 <= s.length <= 10^4`
- `s` consists of lowercase English letters.
- `1 <= k <= 10^4`
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @time - O(n) where n is the length of s
* @space - O(n) where n is the length of s
* @time - O(n) where n is the length of s
* @space - O(n) where n is the length of s
*/
function numKLenSubstrNoRepeats(s: string, k: number): number {
export function numKLenSubstrNoRepeats(s: string, k: number): number {
const n = s.length;

if (k > n) {
Expand Down Expand Up @@ -40,5 +40,5 @@ function numKLenSubstrNoRepeats(s: string, k: number): number {
}
}

return count;
};
return count;
}
Loading