Beispiel #1
0
	def test1(self):
		# Example case
		N = 3245
		self.assertEqual(solution(N), 55)
Beispiel #2
0
from problem2 import solution

num = 1001
print(solution(num))

num = 1
print(solution(num))

num = 12
print(solution(num))

Beispiel #3
0
	def test6(self):
		# No solution
		N = 113
		self.assertEqual(solution(N), -1)
Beispiel #4
0
	def test7(self):
		# Symmetric square
		N = 17*17
		self.assertEqual(solution(N), 17)
Beispiel #5
0
	def test5(self):
		# No solution
		N = 19
		self.assertEqual(solution(N), -1)
Beispiel #6
0
	def test4(self):
		# Binary root equals sqrt(N)
		N = 25
		self.assertEqual(solution(N), 5)
Beispiel #7
0
	def test3(self):
		# Example case
		N = 286
		self.assertEqual(solution(N), 22)
Beispiel #8
0
	def test2(self):
		# Example case
		N = 50
		self.assertEqual(solution(N), 10)
Beispiel #9
0
 def test_solution(self):
     self.assertTrue(p2.solution(self.n1))
     self.assertTrue(p2.solution(self.n2))
     self.assertFalse(p2.solution(self.n3))