805题第二种做法
yuanlu0210 opened this issue · comments
yuanlu0210 commented
805题第二种做法 805.Split-Array-With-Same-Average_DP2.cpp 好像没有考虑到全零并且长度大于1的test case,比如[0, 0, 0, 0, 0],在第20行if (sum*n%total!=0) continue;
处会出现division by zero的错误。
wisdompeak commented
Updated. Add pre-check:
if (total==0) return true;