Skip to content

Commit

Permalink
adding more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
codeperfectplus committed Oct 2, 2021
1 parent 61a227c commit 413cb88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
4 changes: 0 additions & 4 deletions 02. simpleArraySum/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
'''
#!/bin/python3

import os
import sys

#
# Complete the simpleArraySum function below.
#
def simpleArraySum(ar:list):
Expand Down
7 changes: 0 additions & 7 deletions 07. Staircase/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
Problem Statement : Write a program that prints a staircase of size 'n'.
Url : https://www.hackerrank.com/challenges/staircase/problem
'''
#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the staircase function below.
def staircase(n):
Expand Down
17 changes: 6 additions & 11 deletions 08. Mini-MaxSum/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@
'''
#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the miniMaxSum function below.
def miniMaxSum(arr):
""" find the minimum and maximum values that can be calculated by summing exactly four of the five integers """
arr = sorted(arr)
print(sum(arr[:-1]),sum(arr[1:]))

if __name__ == '__main__':
arr = list(map(int, input().rstrip().split()))
return sum(arr[:-1]), sum(arr[1:])

miniMaxSum(arr)
assert miniMaxSum([1, 3, 5, 7, 9]) == (16, 24)
assert miniMaxSum([1, 2, 3, 4, 5]) == (10, 14)
assert miniMaxSum([5, 1, 1, 5]) == (7, 11)
assert miniMaxSum([1, 1, 1, 1, 1]) == (4, 4)

0 comments on commit 413cb88

Please sign in to comment.