Search⌘ K
AI Features

Index Pairs of a String

Index Pairs of a String finds every substring in a given text that matches a word from an array, returning its start and end indices sorted by both positions.

Statement

Given a string text and an array of strings words, return a list of all index pairs [i, ...