DEV Community

Discussion on: Daily Challenge #99 - Balance the Scales

Collapse
 
craigmc08 profile image
Craig McIlwrath

Just spent a few moments reading through your code. Here is some feedback I have, but I'm also kinda new so don't take it too seriously.

  1. You should consider converting the first input array to a 2-tuple. You use it as a tuple in equalizer so having the type be a tuple will make the code clearer. It also forces you to do a little bit of input validation, which is always nice :D

  2. Some functions don't have a great name. Specifically, equalizer and combinationPairs. Personally, they should probably be verbs. combinations = combinePairs weights sounds a bit nicer, in my opinion.

Also, I like the use of applicative functors for the combinePairs function :)

Collapse
 
aminnairi profile image
Amin

Thanks for taking some time to help me on my journey.