Nagarro Interview Question

They asked me to code DNF algorithm both optimised and Bruteforce approach