updated 99problems: slice solution optimized -> tail recuisive and use one additional function

updated slice solution in 99problems:

make it tail recuisive and use one additional function