Tag: string algorithm
Given two strings s0 and s1, return whether you can obtain s1 by removing 1 letter from s0. Example 1 Input s0 = “hello” s1 = “hello” Output false …
Given a list of strings words, concatenate the strings in camel case format. Example 1 Input words = Output “javaBeans” Example 2 Input words = Output “goNasa” How to …
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 a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter …
Given an array of positive integers arr, find a pattern of length m that is repeated k or more times. A pattern is a subarray (consecutive sub-sequence) that consists …