change file reading terminating condition
question broken necklace solution