We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hmm, it seems the initializer in reduce(LCM,A,1) is not needed, since the behavior of reduce for single-element lists is just returning the element. For the sake of curiosity, here's a more packed version of your approach. Arguably, it does push the limits of readability :)
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
Hmm, it seems the initializer in reduce(LCM,A,1) is not needed, since the behavior of
reduce
for single-element lists is just returning the element. For the sake of curiosity, here's a more packed version of your approach. Arguably, it does push the limits of readability :)