I'm a beginner, its been ~2 months since i started learning python.
I've written a code about a function that takes two strings, and outputs the common characters between those 2 strings. The issue with my code is that it returns all common characters that the two inputs have. For example:
input: common, moron
the output is "oommoon" when ideally it should be "omn".
i've tried using the count() function, and then the replace function, but it ended up completely replacing the letters that were appearing more than once in the output, as it should.
how should i go about this? i mean it's probably an easy solution for most of the ppl here, but what will the simplest approach be such that i, a beginner with okay-ish knowledge of the basics, understand it?