NP

Not the most efficient approach, but probably the simplest one