class Solution { public: Solution() { ++n; sum+=n; } static void reset() { n=0; sum=0; } static int getSum() { return sum; } int Sum_Solution(int n) { reset(); Solution *a=new Solution[n]; delete[] a; a=NULL; return getSum(); } private: static int n; static int sum; }; int Solution::n=0; int Solution::sum=0;