A problem is assigned to the NP (nondeterministic polynomial time) class if it is solvable in polynomial time by a nondeterministic Turing machine. A P-problem (whose solution time is bounded by a polynomial) is always also NP.
P-Class
P-class problems take polynomial time to solve a problem like n, n^2, n*logn, etc.
NP-Class
NP-class problems take "Non-Deterministic" polynomial time to quickly check a problem. NP problems are harder & take more time than P-class problems.
There are two parts to proving that the Boolean satisfiability problem (SAT) is NP-complete. SAT is in NP because any assignment of Boolean values to Boolean variables that is claimed to satisfy the given expression can be verified in polynomial time by a deterministic Turing machine.
P-Class Algorithm
The class P consists of those problems that are solvable in polynomial time, i.e. these problems can be solved in time O(nk) in the worst-case scenario, where k is constant. Most known polynomial time algorithms run in time O(nk) for a fairly low value of k.
Factorization is in NP because given the proposed factors of a number, checking that their product is actually that number is easy.
In 2000, American mathematician Stephen Smale devised an influential list of 18 important mathematical problems for solving in the 21st century. The third problem on his list was the P versus NP problem.