Create perm_check.cpp

Solution to the PermCheck problem