Haskell, 47(削除) 47 (削除ここまで) 46 bytes
fst.minimum.filter((/=[]>[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((/=> []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.
Haskell, 47 bytes
fst.minimum.filter((/=[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((/= []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.
Haskell, (削除) 47 (削除ここまで) 46 bytes
fst.minimum.filter((>[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((> []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.
Haskell, 47 bytes
fst.minimum.filter((/=[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((/= []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.
Haskell, 47 bytes
fst.minimum.filter((/=[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((/= []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.
Haskell, 47 bytes
fst.minimum.filter((/=[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((/= []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.
Haskell, 47 bytes
fst.minimum.filter((/=[]).snd).map(span(==' '))
Nothing special here, it's a very standard approach, just with less whitespace. A more presentable version:
main :: IO ()
main = interact (f . lines)
f :: [String] -> String
f = fst -- extract it from the tuple
. minimum -- find the shortest leading whitespace (tuples are sorted by first element)
. filter ((/= []) . snd) -- remove any tuples for which 'everything else' is empty
. map (span (== ' ')) -- split each line into tuples of (leading whitespace, everything else)
Since minimum is a partial function, it will raise an exception if given input that consists only of whitespace. From my perusal of the rules, I'm under the impression that this is acceptable; but I'm fairly new here so please correct me if I'm wrong.