id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

commonDigit


Define a function that when passed two integers, returns true if they have any digit in common, false otherwise. Note: Zero by itself does not contain any digit. So return false if either value is 0.


commonDigit(1729, 234) → true
commonDigit(12345, 54321) → true
commonDigit(12345, 67890) → false

...Save, Compile, Run (ctrl-enter)

boolean commonDigit(int a, int b) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 4 Post-solution available

Copyright Nick Parlante 2017 - privacy