About 11,900,000 results
Open links in new tab
  1. Longest substring with k unique characters - GeeksforGeeks

    Mar 6, 2025 · For a string of length n, there are n * (n + 1) / 2 possible substrings. A straightforward approach is to generate all substrings and check if each contains exactly k …

  2. Longest Substring Without Repeating Characters

    Mar 20, 2025 · Given a string S and an integer k, the task is to return the number of substrings in S of length k with no repeated characters. Example: Input: S = "geeksforgeeks", k = 5Output: …

  3. Python – Extract K length substrings - GeeksforGeeks

    Jan 15, 2025 · Let’s explore various methods to extract substrings of length k from a given string in Python. List comprehension is the most efficient and concise way to extract substrings. It …

  4. string - Find longest substring without repeating characters

    Mar 16, 2012 · Here is the simple python program to Find longest substring without repeating characters

  5. 5 Best Ways to Find the Longest Substring with K Unique ... - Finxter

    Mar 10, 2024 · As a brute force approach, itertools can be used in Python to generate all possible substrings, after which we can filter those with k unique characters and determine the longest …

  6. string - How to find the longest substring with no repeated characters ...

    Jun 13, 2013 · I want an algorithm to find the longest substring of characters in a given string containing no repeating characters. I can think of an O(n*n) algorithm which considers all the …

  7. finding the longest substring in alphabetical order in Python

    Oct 26, 2013 · This allows you to just iterate once through the string O(n) def longest_substring(string): curr, subs = '', '' for char in string: if not curr or char >= curr[-1]: curr …

  8. Longest Substring Without Repeating Characters - LeetCode

    Given a string s, find the length of the longest substring without duplicate characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3.

  9. 395. Longest Substring with At Least K Repeating Characters

    Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k. if no such substring …

  10. Find the Longest Substring Without Repeating Characters

    Jan 8, 2024 · In this tutorial, compare ways to find the longest substring of unique letters using Java. For example, the longest substring of unique letters in “CODINGISAWESOME” is …

  11. Some results have been removed
Refresh