JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
Not able to write efficient code for this problem.can sombody help. | Reply
Find the sum of the digits of all the numbers from 1 to N (both ends included).

For N = 10 the sum is 1+2+3+4+5+6+7+8+9+(1+0) = 46

For N = 11 the sum is 1+2+3+4+5+6+7+8+9+(1+0)+(1+1) = 48
Subject Author Date
Not able to write efficient code for this problem.can sombody help. AayuBala Nov 16, 2014 at 10:27 AM EST
RSS