Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33(削除) 33 (削除ここまで) 31 bytes
-1 byte thanks to Jo King
-2 bytes thanks to Phil H
*.sort:{sort 1,|set -<<.abs.comb<<m:g/\d/}
Explanation
{ } # Map each number, e.g. -373
.abs # Absolute value to remove minus signm: 373
.combg/\d/ # Split intoExtract digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort: # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
{ } # Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort: # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) (削除) 33 (削除ここまで) 31 bytes
-1 byte thanks to Jo King
-2 bytes thanks to Phil H
*.sort:{sort 1,|set -<<m:g/\d/}
Explanation
{ } # Map each number, e.g. -373
m:g/\d/ # Extract digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort: # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
{ } # Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort:{ } # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
# Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort:{ } # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
{ } # Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort: # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
# Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # ConvertPass toas list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort:{ } # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
# Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Convert to list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort:{ } # Sort lexicographically
Perl 6, (削除) 36 (削除ここまで) (削除) 34 (削除ここまで) 33 bytes
-1 byte thanks to Jo King
*.sort:{sort 1,|set -<<.abs.comb}
Explanation
# Map each number, e.g. -373
.abs # Absolute value to remove minus sign: 373
.comb # Split into digits: (3, 7, 3)
-<< # Negate each digit: (-3, -7, -3)
set # Convert to set to remove duplicates
| # Pass as list of pairs: (-3 => True, -7 => True)
1, # Prepend 1 for "none": (1, -3 => True, -7 => True)
sort # Sort (compares 1 and pair by string value): (-7 => True, -3 => True, 1)
*.sort:{ } # Sort lexicographically