Back to problems

Anagrammed indexOf

Algorithm · Databricks · Easy

First Index of an Anagrammatic Substring CodingOnsite, PhoneSoftware EngineerReported Apr, 2026Medium Frequency Problem Overview Write a function that returns the earliest position in a string whose same-length slice is an anagram of a supplied query. Function Signature: Parameters: lookup: The text in which to look query: The character pattern to match in rearranged form Returns: The first starting position of a substring in lookup that rearranges to query -1 when no…

Checking your access…