Simple parity solution exists but done in DP.