That makes sense, thank you so much! I thought I was messing with a type error, which threw me off. That makes sense why Distinct() won't work, because you can have the same item in the list more than once, it just has to be seperated by something else first. Thanks again!
That's not really a type mismatch, it just looks that way. The real error message is the Values differ at index [4] underneath the type mismatch line. Distinct() won't work, though, because not all elements in the output will be unique, look at the examples again.
For simple statements like this, it's quite pythonic to put it on one line. Even for more complicated statements with ifs and for loops and generators, it is still often pythonic to put it on one line.
Haskell tests generate strings outside of ASCII range. Fork here fixes it, along with updating the tests so failure messages are more 7kyu-friendly and show the tested string without the QuickCheck modifier cruft.
i dont undesrtand the instruction
That makes sense, thank you so much! I thought I was messing with a type error, which threw me off. That makes sense why
Distinct()
won't work, because you can have the same item in the list more than once, it just has to be seperated by something else first. Thanks again!That's not really a type mismatch, it just looks that way. The real error message is the
Values differ at index [4]
underneath the type mismatch line.Distinct()
won't work, though, because not all elements in the output will be unique, look at the examples again.This comment is hidden because it contains spoiler information about the solution
How about add a test case where it checks if the input is a mixed array, such as ['5',5]?
For simple statements like this, it's quite pythonic to put it on one line. Even for more complicated statements with ifs and for loops and generators, it is still often pythonic to put it on one line.
YMMV in other languages.
I don't know about industrial programming, but here it is often done like this
Q: How conventional is it to have this on one line over multiple? Apologies if this is a silly question - still learning. :)
Why do we need this code here? Is there some question I missed? Can we have it properly formatted?
This comment is hidden because it contains spoiler information about the solution
Go Translation ;)
Haskell tests generate strings outside of ASCII range. Fork here fixes it, along with updating the tests so failure messages are more 7kyu-friendly and show the tested string without the QuickCheck modifier cruft.
added all 3 to JavaScript
Not an improvement. Rejected.
smart
Loading more items...