about | help | code help+videos | done | prefs |
boolean digitsEqualOrTwice(int num). Given a 2-digit integer (betwen 10-99 inclusive), return true if both digits are the same, or if one digit is twice the value of the other. NOTE: (n / 10) % 10 will extract the left digit (the digit from the tens-column). n % 10 extracts the right digit (the digit from the ones-column). digitsEqualOrTwice(24) → true digitsEqualOrTwice(63) → true digitsEqualOrTwice(55) → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 125
Copyright Nick Parlante 2017 - privacy