Update isPerfect.cpp