コード例 #1
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test1(self):
		# Example case
		N = 3245
		self.assertEqual(solution(N), 55)
コード例 #2
0
ファイル: 2_test.py プロジェクト: kyupkyup/algorithm_practice
from problem2 import solution

num = 1001
print(solution(num))

num = 1
print(solution(num))

num = 12
print(solution(num))

コード例 #3
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test6(self):
		# No solution
		N = 113
		self.assertEqual(solution(N), -1)
コード例 #4
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test7(self):
		# Symmetric square
		N = 17*17
		self.assertEqual(solution(N), 17)
コード例 #5
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test5(self):
		# No solution
		N = 19
		self.assertEqual(solution(N), -1)
コード例 #6
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test4(self):
		# Binary root equals sqrt(N)
		N = 25
		self.assertEqual(solution(N), 5)
コード例 #7
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test3(self):
		# Example case
		N = 286
		self.assertEqual(solution(N), 22)
コード例 #8
0
ファイル: test2.py プロジェクト: jesseyli/Coding-Practice
	def test2(self):
		# Example case
		N = 50
		self.assertEqual(solution(N), 10)
コード例 #9
0
ファイル: test.py プロジェクト: kimegitee/cinnamon
 def test_solution(self):
     self.assertTrue(p2.solution(self.n1))
     self.assertTrue(p2.solution(self.n2))
     self.assertFalse(p2.solution(self.n3))