Nagarro interview question

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