54925493549454955496549754985499550055015502
for (int i=0; i<list.size(); i++) { CardSim currentCard = list.getCard(i); if (ret.countSame(currentCard) <maxSame) { ret.addCard(currentCard); } }