Reimplemented SumMultiples using O(1) algorithm.