DEV Community

Discussion on: Define a haskell function that returns true when the binary representation of a number has more 0s than 1s.

Collapse
 
cappe987 profile image
Casper

When you ask for help you should try to explain what you are struggling with? Is it the Haskell part? Do you have any idea on how to do the logic? Do you need help converting an integer to binary? Don't just copy-paste the problem. That just makes it look like you put no effort into solving it.

To solve this you need to first convert the integer to a binary representation. Then count the 1's and 0's and compare them.