F-Match Score Between Usernames

Asked at Amazon · Coding Questions · Difficulty: Medium

Given `user1`, `user2`, and step `z`, the F-match score is the number of distinct start indices `i` such that the length-`len(user2)` sequence `user1[i], user1[i+z], user1[i+2z], …` (all indices in range) is an anagram of `user2`.

Loading the problem…