Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 621 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 621 Bytes

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.