Create p6.cpp

- already optimized to calculate the sum square difference from startVal to endVal in linear time
- avoid unnecessary calculations by subtracting from sum current value i each time