5 kyu
Keep it short (with restrictions)
219suic
Description:
Task
For a given non-empty list of sets l
return a dictionary where
- keys are the unique elements across all sets
- the value is a number of sets in which the key appears.
The sets are empty or contains only integers.
Don't modify the input list and sets
Example:
# Input: [{1,2,3}, {2,3,4}]
# Output: {4: 1, 2: 2, 3: 2, 1: 1}
# Explanation:
# There are 4 unique elements: 1, 2, 3, 4
# Number 1 appears only in 1 set
# Number 2 appears in 2 sets.
...
Restrictions
Your code mustn't:
- be longer than 1 line and 140 characters.
- contain
return
(search is case insensitive) - contain
;
(i.e. make it a proper one-liner :)) - contain
#
(ergo no explanations :) Let people to enjoy deciphering your puzzling code) - contain more than one
=
(Yes, one=
is enough ;))
Note
This kata is about creativity not proper coding style. Your colleagues/boss won't like you if you make production code like this. :)
Don't forget to rate the kata after you finish it. :)
Happy coding!
suic
Puzzles
Restricted
Similar Kata:
Stats:
Created | Dec 14, 2016 |
Published | Dec 14, 2016 |
Warriors Trained | 585 |
Total Skips | 23 |
Total Code Submissions | 1519 |
Total Times Completed | 219 |
Python Completions | 219 |
Total Stars | 16 |
% of votes with a positive feedback rating | 92% of 92 |
Total "Very Satisfied" Votes | 79 |
Total "Somewhat Satisfied" Votes | 12 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 12 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |