Talk:Summarize and say sequence: Difference between revisions
Content added Content deleted
Line 48: | Line 48: | ||
else: return 1 + seqlen(next(n))</lang> |
else: return 1 + seqlen(next(n))</lang> |
||
:::::::: Before this I had <code>if sorted(n) in cache then: return cache[sorted(n)]</code>, which can lead to incorrect results if a sequence ends in A->B->B, where <code>sorted(A)</code> is the same as <code>sorted(B)</code>. It so happens that it doesn't affect this task, but this consideration is not exactly overgeneralization. --[[User:Ledrug|Ledrug]] 21:26, 25 August 2011 (UTC) |
:::::::: Before this I had <code>if sorted(n) in cache then: return cache[sorted(n)]</code>, which can lead to incorrect results if a sequence ends in A->B->B, where <code>sorted(A)</code> is the same as <code>sorted(B)</code>. It so happens that it doesn't affect this task, but this consideration is not exactly overgeneralization. --[[User:Ledrug|Ledrug]] 21:26, 25 August 2011 (UTC) |
||
:::::::: Ok, yes... that's worthy of a comment in the code. --[[User:Rdm|Rdm]] 21:31, 25 August 2011 (UTC) |