Tag: Two pointer algorithm
Given a string, find the length of the longest substring T that contains at most k distinct characters. Example 1: Input: s = “eceba”, k = 2 Output: 3 …
Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval lists. (Formally, a closed interval …
Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: Output: Explanation: 0,1,2 form a continuous range; 4,5 form a continuous range. Example …
Given a function f(x, y) and a value z, return all positive integer pairs x and y where f(x,y) == z. The function is constantly increasing, i.e.: f(x, y) …
You are given two strings s and t of the same length. You want to change s to t. Changing the i-th character of s to i-th character of …