Solved 301 but slow on python