Skip to content

CodingBat-Logic1-blueTicket #264

@divinedragon

Description

@divinedragon

Write code and JUnit test cases for CodingBat-Logic1-blueTicket

Url - http://codingbat.com/prob/p192267

Problem Statement:

You have a blue lottery ticket, with ints a, b, and c on it. This makes three pairs, which we'll call ab, bc, and ac. Consider the sum of the numbers in each pair. If any pair sums to exactly 10, the result is 10. Otherwise if the ab sum is exactly 10 more than either bc or ac sums, the result is 5. Otherwise the result is 0.

blueTicket(9, 1, 0) → 10
blueTicket(9, 2, 0) → 0
blueTicket(6, 1, 4) → 10

Expected method declaration

public int blueTicket(int a, int b, int c) {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions