524 - Prime Ring Problem basic backtracking, used bitmask