10
最短の一意に識別する部分文字列
文字列のリストが与えられたら、各文字列を、空でない部分文字列の1つで置き換えます。これは、リスト内の他の文字列の部分文字列ではなく、できるだけ短くします。 例 リストを考えると["hello","hallo","hola"]、"hello"ただで置き換える必要があり"e"、この部分文字列がに含まれていないとして、"hallo"そして"hola"、それはできるだけ短くしています。"hallo"いずれかで置き換えることができる"ha"か、"al"と"hola"のいずれかによって"ho"、"ol"または"la"。 ルール 文字列は空ではなく、同じ大文字と小文字のアルファベットのみを含むと想定できます。 このような部分文字列はリスト内の各文字列に存在すると仮定できます。つまり、リスト内の文字列は他の文字列の部分文字列にはなりません。 入力と出力は任意の合理的な形式にすることができます。 これはcode-golfなので、選択した言語でできるだけ少ないバイトを使用するようにしてください。 テストケース ほとんどの場合、可能な出力は1つだけです。 ["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