• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
December 10, 2023 |1.6K Views
PROBLEM OF THE DAY : 09/12/2023 | Smith Number
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Siddharth Hazra. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Number System but also build up problem-solving skills.

In this problem, we are given, a number n, the task is to find out whether this number is a Smith number or not. A Smith number is a composite number whose sum of digits is equal to the sum of digits of its prime factors.

Example :

Input:
n = 4
Output:
1

Explanation:
The sum of the digits of 4 is 4, and the sum of the digits of its prime factors is 2 + 2 = 4.

Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/smith-number4132/1