Tag: Two Pointer
Given two strings s1 and s2, determine if s1 is a subsequence of s2. A string a is a subsequence of another string b if you can delete some …
Given a string S, return the number of substrings that have only one distinct letter. Example 1: Input: S = “aaaba” Output: 8 Explanation: The substrings with one distinct …
Given a string S, return the number of substrings of length K with no repeated characters. Example 1: Input: S = “havefunonleetcode”, K = 5 Output: 6 Explanation: There …
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the …