On Monday, 11 June 2018 at 04:12:57 UTC, Adam D. Ruppe wrote:
On Monday, 11 June 2018 at 04:06:44 UTC, Uknown wrote:
The problem is this prints a list of numbers. The task requires only the largest, so the intuitive fix

I would just pull the max out of it.

http://dpldocs.info/experimental-docs/std.algorithm.searching.maxElement.2.html

Thanks for your reply. I completely forgot about maxElement. I used it, but it prints 1234567, not the permutations. The same happens when using array. Why are the strings getting modified? The same happens with this:

"123".byCodeUnit.permutations.writeln;//[123, 213, 312, 132, 231, 321] "123".byCodeUnit.permutations.array.writeln;//[123, 123, 123, 123, 123, 123]
Seems odd. Is this a bug or expected behaviour?

Reply via email to