Skip to content

GerardSetho/CodilityLessons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages