Q092 python solution with brutal force