We develop a nature-inspired stochastic population-based algorithm and call it discrete particle swarm optimization to find extended two-stage adaptive optimal designs that allow three target response rates for the drug in a phase II trial. Our proposed designs include the celebrated Simon's two-stage design and its extension that allows two target response rates to be specified for the drug. We show that discrete particle swarm optimization not only frequently outperforms greedy algorithms, which are currently used to find such designs when there are only a few parameters; it is also capable of solving design problems posed here with more parameters that greedy algorithms cannot solve. In stage 1 of our proposed designs, futility is quickly assessed and if there are sufficient responders to move to stage 2, one tests one of the three target response rates of the drug, subject to various user-specified testing error rates. Our designs are therefore more flexible and interestingly, do not necessarily require larger expected sample size requirements than two-stage adaptive designs. Using a real adaptive trial for melanoma patients, we show our proposed design requires one half fewer subjects than the implemented design in the study.