Skip to content
Programmingoneonone
Programmingoneonone
  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone

HackerEarth Supernatural problem solution

YASH PAL, 31 July 2024
In this HackerEarth Supernatural problem solution, you are given a number n. A supernatural number is a number whose product of digits is equal to n, and in this number, there is no digit 1. Count the number of supernatural numbers for a given n.
HackerEarth Supernatural problem solution

HackerEarth Supernatural problem solution.

#include<bits/stdc++.h>
using namespace std;
int main(){

int n;
int ans = 0;

cin >> n;
for(int i = 1; i <= 1000000; ++i){
int j = i;
int mul = 1;
bool f = 1;
while(j){
int val = j % 10;
if(val < 2){
f = 0;
break;
}else {
mul *= val;
}
j /= 10;
}
if(mul == n && f)++ans;
}

cout << ans << 'n';

return 0;
}
coding problems solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Programing Practice

  • C Programs
  • java Programs

HackerRank Solutions

  • C
  • C++
  • Java
  • Python
  • Algorithm

Other

  • Leetcode Solutions
  • Interview Preparation

Programming Tutorials

  • DSA
  • C

CS Subjects

  • Digital Communication
  • Human Values
  • Internet Of Things
  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes