Talk:ABC problem: Difference between revisions

Content added Content deleted
Line 10: Line 10:


Also it is possible to make a zero-length word with whatever letters you have. In which case shouldn't the results of <code>can_make_word ""</code> be True? --[[User:Tikkanz|Tikkanz]] ([[User talk:Tikkanz|talk]]) 19:42, 8 January 2014 (UTC)
Also it is possible to make a zero-length word with whatever letters you have. In which case shouldn't the results of <code>can_make_word ""</code> be True? --[[User:Tikkanz|Tikkanz]] ([[User talk:Tikkanz|talk]]) 19:42, 8 January 2014 (UTC)

::I think you can spell the empty string with zero blocks. So the first test should return true. The reasoning is similar to the Python function all([]) returning True. Another clue comes from the Python iterative solution, that has needed a special case for the empty string. Often in algorithms if you have a special case it needs a special justification.-[[User:Bearophile|bearophile]] ([[User talk:Bearophile|talk]])


:Hi, you need one B and two O's but the only blocks with either a B or an O are the ''two'' blocks BO and OB - you can't spell three letters with two blocks! --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 20:30, 8 January 2014 (UTC)
:Hi, you need one B and two O's but the only blocks with either a B or an O are the ''two'' blocks BO and OB - you can't spell three letters with two blocks! --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 20:30, 8 January 2014 (UTC)