last but one using sliding iterator