DS Algo Problems
This blog contain solutions of Data Structure & Algorithm problems.
Pages - Menu
Home
Arrays
Linked List
Stacks
Strings
Trees
Dynamic Programming
Graphs
Hackerrank
Wednesday, 29 June 2016
Hackerrank , 30 Days of Code Challenges ( Day 19 Solution)
Day 19: Interfaces
:
//Write your code here
class Calculator implements AdvancedArithmetic
{
public int divisorSum(int n)
{
int sum=0;
for(int i=1 ; i<=n;i++)
{
if(n%i==0)
sum+=i;
}
return sum;
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment