Substring with Concatenation of All Words
Description: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
For example, given: s: “barfoothefoobarman”, words: [“foo”, “bar”]. You should return the indices: [0,9]. (order does not matter).
Minimum Window Substring
Description: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example, S = “ADOBECODEBANC”, T = “ABC”, Minimum window is “BANC”.
Note:
If there is no such window in S that covers all characters in T, return the empty string “”.
If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S.
Longest Substring Without Repeating Characters
Description: Given a string, find the length of the longest substring without repeating characters.
Examples:
Given “abcabcbb”, the answer is “abc”, which the length is 3.
Given “bbbbb”, the answer is “b”, with the length of 1.
Given “pwwkew”, the answer is “wke”, with the length of 3. Note that the answer must be a substring,
“pwke” is a subsequence and not a substring.
|
|
Longest Palindromic Substring
Description: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
Example 1: Input: “babad”, Output: “bab”, Note: “aba” is also a valid answer.
Example 2: Input: “cbbd”, Output: “bb”
|
|
Palindromic Substrings
Description: Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters.
Example 1: Input: “abc”, Output: 3. Explanation: Three palindromic strings: “a”, “b”, “c”.
Example 2: Input: “aaa”, Output: 6. Explanation: Six palindromic strings: “a”, “a”, “a”, “aa”, “aa”, “aaa”.
Note: The input string length won’t exceed 1000.
Group Anagrams
Description: Given an array of strings, group anagrams together.
For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”],
Return:
[
[“ate”, “eat”,”tea”],
[“nat”,”tan”],
[“bat”]
]
Note: All inputs will be in lower-case.