Skip to content

Commit

Permalink
[Python]Challenge_7(Unreviewed) (YearOfProgramming#289)
Browse files Browse the repository at this point in the history
* appended readme

* typo fix

* Update Solution.py

* Update README.md

* updated readme

* [Python]Challenge_7(Unreviewed)

* Update solution.py

* fixed

* fixed update
  • Loading branch information
MJUIUC committed Jan 8, 2017
1 parent 9fb62ad commit 21aef5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions challenge_7/python/mjuiuc/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Solution

I think I got it figured out. All I had to do was take the sum of the length of the list and then the sum of all the numbers in the list, find the difference betweend those results, and then return the difference modded by the length of the list. The function meets runtime and space requirements.

I included some test cases in my solution.
I think I got it figured out. All I had to do was take the sum of the length of the list and then the sum of all the numbers in the list, find the difference betweend those results, and then return the difference. The function meets runtime and space requirements.

I included some test cases with my solution.
4 changes: 2 additions & 2 deletions challenge_7/python/mjuiuc/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def solution(nums):
Summation = 0
for i in nums:
sums += i
for i in xrange(0,n+1):
for i in xrange(0,n):
Summation += i
return (Summation - sums) % n
return Summation - sums

0 comments on commit 21aef5f

Please sign in to comment.