I've found it a great way to learn those tricks. Once I've solved a problem, working through the way somebody else did it, perhaps in an order of magnitude less time or in an idiomatically different language, has often given me a deeper understanding of the problem. I've learned a couple algorithmic tricks that way, too.
Also, there are some paired problems where the first is small enough to be feasible by a naive solution, but the second would take far too long, and you have to figure out the trick. There's a pair that requires finding the maximum path down a pyramid of numbers, for example, and the second pyramid is several times taller.
Comments
I've found it a great way to learn those tricks. Once I've solved a problem, working through the way somebody else did it, perhaps in an order of magnitude less time or in an idiomatically different language, has often given me a deeper understanding of the problem. I've learned a couple algorithmic tricks that way, too.
Also, there are some paired problems where the first is small enough to be feasible by a naive solution, but the second would take far too long, and you have to figure out the trick. There's a pair that requires finding the maximum path down a pyramid of numbers, for example, and the second pyramid is several times taller.