A Bit of Coding

Given a sequence of cards from a deck of cards (repetitions such as twice ace of hearts are allowed) and a subset of cards, write an algorithm that removes any occurence of any of the cards in the subset from the sequence.

For instance, given the sequence

[As,4s,6h,6h,7d,Kc,Ks]

and the subset

[As,6h]

the output should be

[4s,7d,Kc,Ks]

This entry was posted in Programming. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>