Desiging FSM using D flip flop
Write out the truth table and put it through a logic minimization engine, like Espresso. K-maps are really useful and easy for up to 4 variables, but ultimately, I think they are an educational tool to visualize how to do what Espresso does under the covers by hand. If, however, this is homework... you're on your own :-).