Skip to content

Sander Sæther#97

Open
sandersaether wants to merge 1 commit intoboolean-uk:mainfrom
sandersaether:main
Open

Sander Sæther#97
sandersaether wants to merge 1 commit intoboolean-uk:mainfrom
sandersaether:main

Conversation

@sandersaether
Copy link

No description provided.

numberIn=favouriteNumbers[i];
if (numberIn==num)favNumberInArray=true;

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be simplifed:

public boolean stepFour(int num) {
    for (int i = 0; i < favouriteNumbers.length; i++) {
        if (favouriteNumbers[i] == num) {
            return true;
        }
    }
    return false;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can apply this approach to your other answers to improve readability and efficency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants