Added final modifier
Added caching for Solution's getDistance method