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.
-3 bytes thanks to musicman523. -10 bytes thanks to Blender. -5 bytes thanks to ovs.
Takes input as a list of strings.
lambda a:''.join(map(max,zip(*a)))
Try it online!Try it online!
lambda a:''.join(map(max,*a))
Try it online!
-3 bytes thanks to musicman523. -10 bytes thanks to Blender.
lambda a:''.join(maxmap(x,y)for xmax,y in zip(*a))
-3 bytes thanks to musicman523.
lambda a:''.join(max(x,y)for x,y in zip(*a))
lambda a,b:''.join(max(x,y)for x,y in zip(a,b*a))
lambda a,b:''.join(max(x,y)for x,y in zip(a,b))