Company: Pradaq_27oct
Difficulty: medium
Prefix Optimization Problem Description You are given a list of N words. You are asked to reorder the letters of each word such that the set S of all distinct prefixes of all words is as small as possible. Your task is to find the total number of distinct prefixes in the set S. Notes: It is given that the empty prefix is a prefix of every word, and a word is a prefix of itself. It is guaranteed that the sum of lengths of all words will never exceed 10 6 . Function description Complete the MinimumSet function in the editor below. It has the following parameter(s): N : INTEGER, The number of words S : STRING ARRAY, The list of words The function must return an INTEGER denoting the total number of distinct prefixes of the set S. Input format for debugging The first line contains an integer, N, denoting the number of words. Each line i of the N subsequent lines (where 0 ≤ i < N) contains a string describing the ith word. Examples Example 1: Input: 3 c a ba Output: 4 Explanation: It i