#3435
Frequencies of Shortest Supersequences
international master · 2170 · lc hard +32 · 22.1% accepted · 28 likes · top 2%
Description
You are given an array of strings words. Find all shortest common supersequences (SCS) of words that are not permutations of each other.
A shortest common supersequence is a string of minimum length containing each string in words as a subsequence.
Return a 2D array freqs where each freqs[i] is an array of size 26 representing the character frequencies of one distinct SCS. You may return frequency arrays in any order.
Code
1
2
3