|
Problem Description |
Problem Description |
|
Comments from those who are working on this Kata |
|
Here you could write some thoughts about what you have learnt from this Kata. If you want to discuss your approach and give some code samples, you might want to link to a new page "KataXByY?". You don't have to post all the code of your solution, or claim that it is the best possible solution. What is interesting is your insights into the problem, and decisions you made in the past. |
Comments from those who are working on this KataHere you could write some thoughts about what you have learnt from this Kata. If you want to discuss your approach and give some code samples, you might want to link to a new page "KataXByY?". You don't have to post all the code of your solution, or claim that it is the best possible solution. What is interesting is your insights into the problem, and decisions you made in the past. Different Languages* Python classic recursive solution, code and some discussion [1] * Ruby styled Regular Expression solution, code [2] * Forth, code [3] and feedback in the newsgroup [4] * Java various solutions, code together with discussion [5] Different AlgorithmsI (PeterKofler?) did the kata several times in Java and tried a different variants each time. The different algorithms have increased complexity in code but reduce the number of allocations. See [5] for a detailed analysis of the variants together with code. It's nice to see how the solution changes from recursive to tail recursive to a loop which can be optimised even further. |