def integratedLevel(numbers: str, sublength: int): from probs.prob02_algospot_pi.pi import subSameNumber, subSimpleIncrease, \ subSimpleDecrease, subRotate, subArithmeticSequence if subSameNumber(numbers, sublength): return 1 if subSimpleIncrease(numbers, sublength): return 2 if subSimpleDecrease(numbers, sublength): return 2 if subRotate(numbers, sublength): return 4 if subArithmeticSequence(numbers, sublength): return 5 return 10
def test_subSimpleDecrease_8(self): self.assertEqual(subSimpleDecrease('43214', 5), False)
def test_subSimpleDecrease_6(self): self.assertEqual(subSimpleDecrease('3212', 3), False)
def test_subSimpleDecrease_7(self): self.assertEqual(subSimpleDecrease('3213', 4), False)
def test_subSimpleDecrease_5(self): self.assertEqual(subSimpleDecrease('1210', 3), True)
def test_subSimpleDecrease_4(self): self.assertEqual(subSimpleDecrease('1432', 3), True)
def test_subSimpleDecrease_3(self): self.assertEqual(subSimpleDecrease('154321', 5), True)
def test_subSimpleDecrease_2(self): self.assertEqual(subSimpleDecrease('14321', 4), True)
def test_subSimpleDecrease_1(self): self.assertEqual(subSimpleDecrease('1321', 3), True)