Skip to content

Commit

Permalink
Create scope.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mahakagarwal248 authored Oct 19, 2020
1 parent 0ba72f5 commit a131ffb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions c++/scope.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

Difference(vector<int>v)
{
elements=v;
}
void computeDifference()
{
maximumDifference=0;
for(int i; i<elements.size(); i++)
{
for(int j=i+1;j<elements.size();j++)
{
if(abs(elements[i]-elements[j])>maximumDifference)
{
maximumDifference=abs(elements[i]-elements[j]);
}
}
}
}
// Add your code here

0 comments on commit a131ffb

Please sign in to comment.