Problem 1.1 Broken Necklace - C++ Solution