Skip to content

Commit 413cb88

Browse files
adding more test cases
1 parent 61a227c commit 413cb88

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

02. simpleArraySum/solution.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
'''
88
#!/bin/python3
99

10-
import os
11-
import sys
12-
13-
#
1410
# Complete the simpleArraySum function below.
1511
#
1612
def simpleArraySum(ar:list):

07. Staircase/solution.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
Problem Statement : Write a program that prints a staircase of size 'n'.
66
Url : https://www.hackerrank.com/challenges/staircase/problem
77
'''
8-
#!/bin/python3
9-
10-
import math
11-
import os
12-
import random
13-
import re
14-
import sys
158

169
# Complete the staircase function below.
1710
def staircase(n):

08. Mini-MaxSum/solution.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@
1111
'''
1212
#!/bin/python3
1313

14-
import math
15-
import os
16-
import random
17-
import re
18-
import sys
19-
2014
# Complete the miniMaxSum function below.
2115
def miniMaxSum(arr):
16+
""" find the minimum and maximum values that can be calculated by summing exactly four of the five integers """
2217
arr = sorted(arr)
23-
print(sum(arr[:-1]),sum(arr[1:]))
24-
25-
if __name__ == '__main__':
26-
arr = list(map(int, input().rstrip().split()))
18+
return sum(arr[:-1]), sum(arr[1:])
2719

28-
miniMaxSum(arr)
20+
assert miniMaxSum([1, 3, 5, 7, 9]) == (16, 24)
21+
assert miniMaxSum([1, 2, 3, 4, 5]) == (10, 14)
22+
assert miniMaxSum([5, 1, 1, 5]) == (7, 11)
23+
assert miniMaxSum([1, 1, 1, 1, 1]) == (4, 4)

0 commit comments

Comments
 (0)