Unique characters: Difference between revisions
→{{header|Python}}: Added a variant which reduces the strings down to a hash of character frequencies
(→{{header|Python}}: Added a variant which reduces the strings down to a hash of character frequencies) |
|||
Line 914:
<lang python>'''Unique characters'''
from
#
def
'''Characters which occur only once
across the given list of strings.
'''
return sorted([
lambda dct, w: reduce(
c: 1 + a[c] if c in a else 1
]▼
}),
w,
dct
),
ws,
{}
).items()
if 1 == v
▲ ])
Line 932 ⟶ 941:
# main :: IO ()
def main():
'''Test'''▼
▲ '''
print(
"133252abcdeeffd",
"a6789798st",
|