5 kyu

Keep it short (with restrictions)

219suic

Description:

Task

For a given non-empty list of sets l return a dictionary where

  1. keys are the unique elements across all sets
  2. 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:

  1. be longer than 1 line and 140 characters.
  2. contain return (search is case insensitive)
  3. contain ; (i.e. make it a proper one-liner :))
  4. contain # (ergo no explanations :) Let people to enjoy deciphering your puzzling code)
  5. 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

Stats:

CreatedDec 14, 2016
PublishedDec 14, 2016
Warriors Trained585
Total Skips23
Total Code Submissions1519
Total Times Completed219
Python Completions219
Total Stars16
% of votes with a positive feedback rating92% of 92
Total "Very Satisfied" Votes79
Total "Somewhat Satisfied" Votes12
Total "Not Satisfied" Votes1
Total Rank Assessments12
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • suic Avatar
  • tachyonlabs Avatar
  • saudiGuy Avatar
Ad