This is a program of solving Karnaugh Map(K-Map). This is a method of simplifying Boolean expressions. Here I have written code to solve or 2,3 and 4 variables but in real life problems circuits would have thousands of variables.
If you are a beginner you can learn more about Kmaps on Wikipedia, and GeeksforGeeks
If you want to go in depth the following two books are great
PS Don't use this code to solve assignments quickly instead use to check answers, solving by hand will make your fundamentals strong:)