in reply to SEEKING HELP
Is this your homework?
by adding the 0s and 1s ... keep ... strings that have 0s and 2s only, no 1s in the string.
This logic is akin to NXOR ie equality. You effectively filter by exact (attributes) match. Do you really need to output "2"-s instead of "1"-s? Secondly, how would the "M" and "P" tags combine? As "MP", or should the tag be elided maybe?
|
|---|