3 ms·
well, I hate to beat a dead horse, but here's a one-liner (ruby): (map1.keys | map2.keys).map(&:to_s).sort.join(", ").instance_eval { empty? ? "<none>" : sel
by markov_twain 14y ago
well, I hate to beat a dead horse, but here's a one-liner (ruby):
(map1.keys | map2.keys).map(&:to_s).sort.join(", ").instance_eval { empty? ? "<none>" : self }
- Luyt 14y agoMy one-liner: a = {"fred": 4, "wilma": 8} b = {"t-shirt": 6, "fred": 0} print ", ".join(sorted(set(a).union(b))) or "<none>"