Recursive Digit Sum (Super Digit ) in Java | Hacker Rank Interview Preparation | Solved in 3 Ways
2.9 هزار بار بازدید -
2 سال پیش
-
This video is about Step
This video is about Step by step explanation of Recursive Digit Sum problem on Hacker Rank.
We define super digit of an integer using the following rules:
Given an integer, we need to find the super digit of the integer.
If has only digit, then its super digit is .
Otherwise, the super digit of is equal to the super digit of the sum of the digits of .
For example, the super digit of will be calculated as:
super_digit(P) = super_digit(148148148)
= super_digit(1+4+8+1+4+8+1+4+8)
= super_digit(39)
= super_digit(3+9)
= super_digit(12)
= super_digit(1+2)
= super_digit(3)
= 3
---------------------------------------------------------------------------------------------------------------------
In this video, we will be solving this Recursive Digit Sum problem in 3 different ways !
- Iteration
- Recursion
- Shortcut O(1)
Just visit the below website for code:-
http://bit.do/nobi
Don't' Forget to Like, Share and Subscribe for future updates...
Thank you!!!!!!!!
After copying and pasting the code, still not working
Don't Worry I'm hereby to help you
Ping me on Instagram.
💎FOLLOW US ON INSTAGRAM: Instagram: shivasai_alle
We define super digit of an integer using the following rules:
Given an integer, we need to find the super digit of the integer.
If has only digit, then its super digit is .
Otherwise, the super digit of is equal to the super digit of the sum of the digits of .
For example, the super digit of will be calculated as:
super_digit(P) = super_digit(148148148)
= super_digit(1+4+8+1+4+8+1+4+8)
= super_digit(39)
= super_digit(3+9)
= super_digit(12)
= super_digit(1+2)
= super_digit(3)
= 3
---------------------------------------------------------------------------------------------------------------------
In this video, we will be solving this Recursive Digit Sum problem in 3 different ways !
- Iteration
- Recursion
- Shortcut O(1)
Just visit the below website for code:-
http://bit.do/nobi
Don't' Forget to Like, Share and Subscribe for future updates...
Thank you!!!!!!!!
After copying and pasting the code, still not working
Don't Worry I'm hereby to help you
Ping me on Instagram.
💎FOLLOW US ON INSTAGRAM: Instagram: shivasai_alle
2 سال پیش
در تاریخ 1401/02/16 منتشر شده
است.
2,915
بـار بازدید شده