Easy level questions
-
Word Break:
- Input: s = "leetcode", wordDict = ["leet", "code"]
- Output: True
- Explanation: "leetcode" can be segmented into "leet" and "code".
-
Longest Palindromic Substring:
- Input: s = "babad"
- Output: "bab" or "aba"
- Explanation: Both "bab" and "aba" are valid longest palindromic substrings.
-
Regular Expression Matching:
- Input: s = "aa", p = "a*"
- Output: True
- Explanation: Pattern "a*" matches zero or more occurrences of 'a'.
-
Letter Combinations of a Phone Number:
- Input: digits = "23"
- Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]
- Explanation: Corresponding letters for digits 2 and 3 are "abc" and "def" respectively.
-
Valid Palindrome II:
- Input: s = "abca"
- Output: True
- Explanation: By deleting 'b', the resulting string "aca" is a palindrome.
-
Group Anagrams:
- Input: strs = ["eat", "tea", "tan", "ate", "nat", "bat"]
- Output: [["bat"], ["nat","tan"], ["ate","eat","tea"]]
- Explanation: Anagrams are grouped together.
-
Minimum Window Substring:
- Input: s = "ADOBECODEBANC", t = "ABC"
- Output: "BANC"
- Explanation: The minimum window substring containing all characters from t is "BANC".
-
Decode String:
- Input: s = "3[a]2[bc]"
- Output: "aaabcbc"
- Explanation: Decode the string by repeating substrings inside brackets.
-
Permutations:
- Input: nums = [1,2,3]
- Output: [[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]
- Explanation: All possible permutations of the input list.
-
Add Binary:
- Input: a = "11", b = "1"
- Output: "100"
- Explanation: Binary addition of "11" and "1" results in "100".
Top comments (0)