Example #1
0
from problem1 import solution

n = "asdfasdfQWE"
print(solution(n))

n = "QWRGqweASDF"
print(solution(n))

n = "qweQWQEqwe"
print(solution(n))
Example #2
0
	def test7(self):
		# Single item array
		A = [15.0]
		self.assertEqual(solution(A),15)
Example #3
0
	def test1(self):
		# Example case
		A = [1.0, 0.1, -1.0, -7.0, 3.0, -5.0, -2.5, 0.0, 1.0]
		self.assertEqual(solution(A), 262.5)
Example #4
0
	def test6(self):
		# All negative values less than 1
		A = [-0.1, -0.2, -0.3, -0.5, -0.25, -0.25]
		self.assertEqual(solution(A),0.15)
Example #5
0
	def test5(self):
		# Single negative value and zeros
		A = [-5,-5, 0, 0, 0, 0]
		self.assertEqual(solution(A),25)
Example #6
0
	def test4(self):
		# All negative values
		A = [-1.0, -2.0, -3.0, -0.5, -0.25, -10.0]
		self.assertEqual(solution(A),7.5)
Example #7
0
	def test3(self):
		# Array of zeros
		A = [0.0,0.0,0.0,0.0]
		self.assertEqual(solution(A), 0)
Example #8
0
	def test2(self):
		# Product goes over 10^9
		A = [-0.00001, 1000.0, 1000.0, 1000.0, 1000.0, -100.0, 0.000001]
		self.assertEqual(solution(A), 1e9)