10
最短的唯一标识子字符串
给定一个字符串列表,请用其非空子字符串之一替换每个字符串,该子字符串不是列表中任何其他字符串的子字符串,并且应尽可能短。 例 给定list ["hello","hallo","hola"],"hello"应替换为,"e"因为该子字符串未包含在其中"hallo","hola"并且它尽可能短。"hallo"可通过任一取代"ha"或"al"并"hola"通过任何"ho","ol"或"la"。 规则 您可以假定字符串将为非空,并且仅包含大小写相同的字母字符。 您可以假定列表中的每个字符串都存在这样的子字符串,即列表中的任何字符串都不是其他任何字符串的子字符串。 输入和输出可以采用任何合理的格式。 这是code-golf,因此请尝试使用您选择的语言使用尽可能少的字节。 测试用例 在大多数情况下,仅给出一种可能的输出。 ["ppcg"] -> ["p"] (or ["c"] or ["g"]) ["hello","hallo","hola"] -> ["e","ha","ho"] ["abc","bca","bac"] -> ["ab","ca","ba"] ["abc","abd","dbc"] -> ["abc","bd","db"] ["lorem","ipsum","dolor","sit","amet"] -> ["re","p","d","si","a"] ["abc","acb","bac","bca","cab","cba"] -> ["abc","acb","bac","bca","cab","cba"] 相关:最短识别子字符串 -类似的想法,但涉及更多规则和繁琐的格式。
23
code-golf
string
code-golf
string
code-golf
array-manipulation
code-golf
quine
code-golf
array-manipulation
integer
matrix
classification
code-golf
quine
code-golf
string
matrix
conversion
code-golf
string
number
code-golf
string
code-golf
number
sequence
integer
code-golf
decision-problem
matrix
code-golf
string
code-golf
math
code-golf
math
array-manipulation
combinatorics
code-golf
random
code-golf
code-golf
alphabet
code-golf
python
c
code-golf
base-conversion
code-golf
string
counting
code-challenge
code-generation
fastest-code
code-golf
kolmogorov-complexity
matrix
code-golf
string
code-golf
array-manipulation
decision-problem
random
sudoku
code-golf
chess
code-golf
card-games
encode
code-golf
decision-problem
code-golf
code-golf
math
array-manipulation
matrix