stringを指定すると、ソースコードでの表示順序に従ってx
文字がx
ソートされて出力されます。
例
Source: ThisIs A Test
Input: Is it a Test?
Output: TissI etta?
Source: Harry - yer a wizard.
Input: I'm a what?
Output: aa wh'?Imt
Source: Mr. H. Potter, The Floor, Hut-on-the-Rock, The Sea
Input:
Output:
ルール
- 標準的な抜け穴とI / Oルールが適用されます
- 入力と出力は、文字列、文字のリスト、またはバイトのリストのいずれかです。
- If a character is used multiple times in the source, use the first occurrence.
- If one or more characters does not appear in the source, they should be at the end; their order does not matter, nor does it have to be consistent.
- Source must be non-empty
- Newlines are treated the same as other characters.
- The order in which the code is executed doesn't matter; just the raw string.
- The input is in the same encoding as the code.
- The input is sorted by characters, not by bytes.
- Sorting is case sensitive
- This is code-golf, so shortest answer in bytes for each language wins!
x
encoded in UTF-8 or UTF-16 if our solution isn't encoded in Unicode at all, and the Unicode characters in x
represent characters in the solution's code page? For example, some golfing languages use custom code pages to reduce their byte count but still be readable with the naked eye.