I found a corner case on the find sum in list that I overlooked. If the list is [1,2,5] and the number is 4 I will return true because I am looking through the whole list for K-element and will of course find element. I was so happy to get a single line that worked, I am wondering if I can fix it and still keep it one line?

git.qoto.org/Absinthe/sum-of-n

I know count may work better than any, or some other logic to handle the special case of K-element == element

@zingbretsen care to take a shot at a fix for my one-line solution in this one?

Follow

@Absinthe I have an idea, but not sure if it will work in one line

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.