took to long to solve this damn word break question (tle problem)
added pow solution