We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Find Digits
- Discussions
Find Digits
Find Digits
Sort by
recency
|
1667 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanation here : https://youtu.be/iTxLvVxH5pY
Perl:
can you find mistake in this code plz??
include
using namespace std; int main(){ int n; cin>>n; int result = 0; long long int t; for(int i=0;i>t; } while(t--){ int d=t% 10; if(d!=0 && t%d==0 ) result ++;
} cout<
Java solution:
Here is my Python solution using list comprehensions! The first list is all the digits that are not 0, and the second list is all the numbers in that list that evenly divide the number. We then return the length of that list, which is the amount of numbers that work.