Palindromes in Base-10 and Base-k
Return the first n integers that are palindromes in both base-10 and base-k.
Input: n = 2, k = 4
Output: [1, 5]
Explanation: 1 is '1' in base 4, and 5 is '11' in base 4. Both are perfect palindromes in decimal and base 4 simultaneously.
Count Anagrammatic Substrings
Count the number of anagrammatic substrings from one string present in another.
Input: s = "abab", p = "ab"
Output: [0, 1, 2]
Explanation: The substrings "ab", "ba", and "ab" starting at indices 0, 1, and 2 respectively are all anagrams of the string "ab".
Add Two Numbers Represented as Strings
Add two non-negative integers represented as strings.
Input: num1 = "456", num2 = "77"
Output: "533"
Explanation: Performs character-by-character addition from right to left, carrying the 1 from 6+7=13 to the next decimal place.
Top K Frequent Elements
Find the top K frequent elements in an array.
Input: nums = [4,4,4,4,5,5,6], k = 1
Output: [4]
Explanation: The number 4 appears four times, easily making it the single most frequent element in the data structure.