OutputsTry it online or verify all test cases.
Or alternatively with just a sort-by without filter:
ŒéΣláDêAQig]н
Try it online or verify all test cases.
Both output an empty string as falsey. (couldCould have been 12 bytes if we would be allowed to output -1
as falsey with ŒéΣág}.ΔlêAå
).
Try it online or verify all test cases.)
Œ # Get all substrings of the (implicit) input-string
ʒ # Filter this list by:
l # Convert the current substring to lowercase
ê # Uniquify and sort all characters in the string
A # Push "abcdefghijklmnopqrstuvwxyz"
å # Check if the lowercase alphabet is in the uniquify-sorted substring
}é # After the filter: sort any remaining substrings from shortest to longest
Σ # Then sort it again by:
á # Leave just all the letters of the substring
g # Pop and push the length for the amount of letters
}н # After the sort-by: pop and leave just the first
# (or an empty string if the list is empty)
# (which is output implicitly as result)
Œ # Get all substrings of the (implicit) input-string
é # Sort them by length (shortest to longest)
Σ # Then sort it again by:
l # Convert the current substring to lowercase
á # Leave just all the letters of the substring
D # Duplicate it
ê # Uniquify and sort all characters in the letters in the string
AQi # Pop, and if it's equal to the lowercase alphabet:
g # Pop and push the length for the amount of letters
] # Close both the if-statement and sort-by
# (note, integers are always sorted before strings, even if there are
# digits in the input-string)
н # Pop and leave just the first result
# (or an empty string if the list is empty)
# (which is output implicitly as result)