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.
Lucky Numbers
Lucky Numbers
Sort by
recency
|
74 Discussions
|
Please Login in order to post a comment
why 23 in between 21 and 25 is not lucky number,
as we are getting digit sum 5, and sum of square of digits are 13.
i think the same like you, can't understand anyone who get max score in this task
going by problem description looks like 23 should be lucky number, either description of problem is wrong or test case.
I agree .. the test cases are wrong ... 23 is a lucky number!
Yes, it's been 3 month, why is nobody fixing this?
I believe there are no such things as unlucky numbers; it's all just nonsense. Numerology seems to be nothing more than a theory created by enthusiasts trying to link real life and numbers with mysticism. Building inspections Perth
def luckyNumbers(a, b): lucky_nums=[] seq=range(a,b+1) for num in seq: number=num sum=0 sum_sqr=0 while num!=0: remain=num%10 sum+=remain sum_sqr+=(remain**2) num=num//10
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Lucky Numbers Problem Solution
Why not work for number very long in javascript?