Showing 3 of 31 questions
Given a string and two substrings, find the indices where the first substring occurs. Then, find the indices where the second substring occurs. Return the indices of the first substring that are close to any index of the second substring, within a specified range.
#1. Find Beautiful Indices in the Given Array I
You're given a string and a list of index pairs. You can swap characters at these indices any number of times. Find the lexicographically smallest string you can obtain after performing these swaps.
#2. Smallest String With Swaps
You're given a string and two patterns. Find all 'beautiful' indices where an occurrence of the first pattern is within 'k' distance of an occurrence of the second pattern.
#3. Find Beautiful Indices in the Given Array II