The solution I gave picks from the available responses at each stage in alphabetical order. It’s not the way I would play a real game. When I play Mastermind, I keep piles of colors with information in my head.
For colors here, I start with A,B,C.
If all three are right, then good.
If one is right, then D and E are colors and one of A,B,C. My round two guesses for these cases use A,D,E.
(If your guess is always three distinct colors, then one color right always tells you that the other two are good colors. Once you know two for sure, every guess either tells you that one of the other three colors is right or wrong.)
If two are right, then I would have a pile of A,B,C and remember that my answer needs two of them and a pile of D,E and I need one of them.
My round two guess for these cases use A,B,D for colors.
For round three
If your A,B,D guess has one color right, then you know C and E and are correct and one A and B. I chose to check A,C,E first
If you’re A,B,D guess has two colors right, then you either need to swap A or B for C or you need to swap D for E. I chose to swap B for C and guess using A,C,D. You can tell right away by whether number of correct colors stayed the same, decreased or increased whether the B -> C swapped good for good (B,C is right and so is D), good for bad (A,B is right and so is E) or bad for good (A,C is right and so is D).
For positions, I just choose the first one alphabetically to go in the earliest correct position or not go in the earliest wrong position working through to the current guess, and then move on to the next color.