Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max builtins (Z/à/M) have weird behavior on lists of lists of integers that includes an empty inner list #205

Open
kcruijss opened this issue Apr 24, 2024 · 0 comments

Comments

@kcruijss
Copy link

kcruijss commented Apr 24, 2024

The min/max builtins will give the flattened integer on multi-dimensional list arguments, which is a great feature I've used a lot of times.

However, there seems to be unexpected behavior when a list of lists of integers includes an empty list. At first I thought it ignored all integers after the last empty list, but apparently that's not the case either.

For example, with list [[0, 5], [], [2], [3, 1]], I'd expect the flattened maximum to be 5, but it returns 3 instead.

Try it online. The first and last test cases are currently wrong (I'm expecting 5 and 1 instead of 3 and 0 respectively); the other three are correct.
Found in this 05AB1E answer of mine. - Try it online (expecting 1, but got 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant