Yahoo India Web Search

Search results

  1. 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.

  2. Longest Substring Without Repeating Characters - Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3.

  3. Given a string S, find the length of the longest substring without repeating characters. Example 1: Input: S = "geeksforgeeks" Output: 7 Explanation: Longest substring is "eksforg". Example 2: Input: S = "abdefgabef&q

  4. Apr 15, 2024 · Given a string str, find the length of the longest substring without repeating characters. Example: Example 1: Input: “ABCDEFGABEF” Output: 7 Explanation: The longest substring without repeating characters are “ABCDEFG”, “BCDEFGA”, and “CDEFGAB” with lengths of 7. Example 2: Input: “GEEKSFORGEEKS” Output: 7

  5. Jul 5, 2022 · Given a string, print the longest substring without repeating characters. For example, the longest substrings without repeating characters for “ABDEFGABEF” are “BDEFGA” and “DEFGAB”, with length 6. For “BBBB” the longest substring is “B”, with length 1. The desired time complexity is O(n) where n is the length of the string.

  6. 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 exists, return 0.

  7. Jul 19, 2020 · PROBLEM: Given integers n, k (1 <= n <= 100.000), (1 <= k <= n). Find the length of the longest substring with at most K repeating characters and find position of the first element in the substring from the original string. EXAMPLES.

  8. Mar 16, 2012 · Algorithm: 1) Initialise an empty dictionary dct to check if any character already exists in the string. 2) cnt - to keep the count of substring without repeating characters. 3) l and r are the two pointers initialised to first index of the string. 4)loop through each char of the string.

  9. Dec 14, 2020 · We can convert a substring into a repeating substring if, (L - MX) <= K (where ‘L’ is the length of substring and ‘MX’ is the count of the character which occurs maximum times in substring). We define the window bounded by two pointers ‘i’ and ‘j’ and the window size is (j-i+1).

  10. A valid substring would be "aaa" because the character 'a' appears at least 3 times. The substring "aaabb" is not valid because the character 'b' only appears twice, which is less than k. The goal is to return the length of the longest valid substring.