No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/net/gerardsetho/codility/iterations
README.md

README.md

Codility Lessons

I share my Java solutions to Codility's Lessons here. The lessons are on Codility.com here
These solutions have the emphasis on readability.

So instead of writing

    if ((N >> i & mask) == 1) {
       ...
    }

I would use

    // shift the current bit to the right most bit
    int currentN = N >> i;
    
    // and extract the right most bit
    int rightMostBit = currentN & mask;
    
    if (rightMostBit == 1) {
        ...
    }

The Java compiler is able to easily optimize such readability formatting.