Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Saved 57 bytes thanks to @Mr.Xcoder and, @pizzapants184 and @ovs
lambda a,b:max(f for f in a if f*(a.count(f)==b.count(f)<2)for f in a)
Try it online!Try it online!
Saved 5 bytes thanks to @Mr.Xcoder and @pizzapants184
lambda a,b:max(f for f in a if a.count(f)==b.count(f)<2)
Try it online!
Saved 7 bytes thanks to @Mr.Xcoder, @pizzapants184 and @ovs
lambda a,b:max(f*(a.count(f)==b.count(f)<2)for f in a)
lambda xa,yb:max(lf for lf in{*x}&{*y} a if xa.count(lf)+y==b.count(lf)<3<2)
lambda x,y:max(l for l in{*x}&{*y}if x.count(l)+y.count(l)<3)