---
title: "Discussion on \"Longest Substring with At Most K Distinct Characters\" | Hashnode"
description: "Discussion on \"Longest Substring with At Most K Distinct Characters\". Problem\nGiven a string str and an integer K, return the length of the longest substring containing at most K distinct characters.\n\nA substring is a continuous part of the string. You cannot skip chara"
url: "https://hashnode.com/posts/longest-substring-with-at-most-k-distinct-characters/6ae85e35ccf2d2a916990ccb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Longest Substring with At Most K Distinct Characters](https://chetan77.hashnode.dev/longest-substring-with-at-most-k-distinct-characters?utm_source=hashnode&utm_medium=feed)

Problem Given a string str and an integer K, return the length of the longest substring containing at most K distinct characters. A substring is a continuous part of the string. You cannot skip chara

Nov 2 · 4 min read · chetan77.hashnode.dev  
Read the article

## Written by

[Chetan Datta](https://hashnode.com/@chetan77)

@chetan77 · Hyderabad, India

  
[View profile](https://hashnode.com/@chetan77)

Software Engineer

I share my learnings here. Thanks for reading.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
