Removing the Consecutive characters by the order of given integer passed