How practice makes perfect: the role of persistence, flexibility and learning in problem-solving efficiency