Help! My Completely Automated Lights From Darks Separator V3001.01 broke! :(
Guidelines
Task
Write a program that will take an input of an array (or a list in some languages) of any amount of strings that are either the letter L or the letter D (representing lights or darks) and output an array that contains two arrays, one with all the L's, and one with all the D's.
Rules
- It's code golf so the shortest answer in bytes wins
- Input will only ever contain capitals
- There must be the same number of L's in the output as there is in the input, same goes for the D's
- The input may only have one element (or maybe even zero elements)
- If one or both of the output arrays contain no elements, output an empty list (in some languages this may mean you need to output a string)
- Always have the first array be the array of L's
Example output:
["L","D","L","D","D"] -> [["L","L"],["D","D","D"]]
["L","L","L"] -> [["L","L","L"],[]]
["D","D"] -> [[],["D","D"]]
[] -> [[],[]]
"LDLDD" -> "LL DDD"
or something like that? \$\endgroup\$["L","L",["D","D","D"]]
. \$\endgroup\$