Talk:Solve hanging lantern problem: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
Line 9: Line 9:


:: Hm. My solution was just to use the index of the column instead of its value as the number to repeat (<tt>[fill(i,m) for (i, m) in enumerate(inputs)]</tt>. Not sure I understand what your new solution is doing instead. -- [[User:Markjreed|Markjreed]] ([[User talk:Markjreed|talk]]) 22:24, 22 May 2022 (UTC)
:: Hm. My solution was just to use the index of the column instead of its value as the number to repeat (<tt>[fill(i,m) for (i, m) in enumerate(inputs)]</tt>. Not sure I understand what your new solution is doing instead. -- [[User:Markjreed|Markjreed]] ([[User talk:Markjreed|talk]]) 22:24, 22 May 2022 (UTC)

::: I was trying to make it better fit the original specifications, but that did not work at first, sorry. --[[User:Wherrera|Wherrera]] ([[User talk:Wherrera|talk]]) 23:22, 22 May 2022 (UTC)

Revision as of 23:23, 22 May 2022

Rename Task

The task should be renamed to begin with a verb and leave subsequent words uncapitalized. Perhaps Solve_hanging_lantern_problem? --Markjreed (talk) 21:43, 22 May 2022 (UTC)

Duplicate Column Sizes

The Julia solution considered two columns with the same number of lanterns indistinguishable, and therefore output a total of only 7 sequences when given 3 columns of 1, 3, and 3 lanterns. Since the problem statement gives an example in which each lantern is individually numbered, I infer that columns with the same number of lanterns should not be interchangeable and 3 columns [1,3,3] should yield 140 distinct sequences. I have edited the Julia solution to match this interpretation, and based a Raku solution on it. But perhaps some more clarity and/or some examples in the problem statement are called for. -- Markjreed (talk) 21:24, 22 May 2022 (UTC)

Ah, that case I did not consider. Fixed by making the numbers in the columns different with duplicate length columns. -- Wherrera (talk) 22:17, 22 May 2022 (UTC)
Hm. My solution was just to use the index of the column instead of its value as the number to repeat ([fill(i,m) for (i, m) in enumerate(inputs)]. Not sure I understand what your new solution is doing instead. -- Markjreed (talk) 22:24, 22 May 2022 (UTC)
I was trying to make it better fit the original specifications, but that did not work at first, sorry. --Wherrera (talk) 23:22, 22 May 2022 (UTC)