Skip to content

CodingBat-Logic1-shareDigit #265

@divinedragon

Description

@divinedragon

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

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

Problem Statement:

Given two ints, each in the range 10..99, return true if there is a digit that appears in both numbers, such as the 2 in 12 and 23. (Note: division, e.g. n/10, gives the left digit while the % "mod" n%10 gives the right digit.)

shareDigit(12, 23) → true
shareDigit(12, 43) → false
shareDigit(12, 44) → false

Expected method declaration

public boolean shareDigit(int a, int b) {
}

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