Algorithm · Roblox · Medium
You are given an array of distinct strings called words. Your task is to filter out any string that serves as a prefix of some other string in the array. We say that string a is a prefix of string b when b starts with the entire content of a, and additionally the length of a is strictly smaller than the length of b. Return a list containing only the strings that are not a prefix of any other string in words. The relative order of the kept strings must be identical to the…
Checking your access…