Skip to content

CodingBat-Logic1-lastDigit #258

@divinedragon

Description

@divinedragon

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

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

Problem Statement:

Given three ints, a b c, return true if two or more of them have the same rightmost digit. The ints are non-negative. Note: the % "mod" operator computes the remainder, e.g. 17 % 10 is 7.

lastDigit(23, 19, 13) → true
lastDigit(23, 19, 12) → false
lastDigit(23, 19, 3) → true

Expected method declaration

public boolean lastDigit(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