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
Example #2
0
 def test_sub_8(self):
     self.assertEqual(subRotate('3432', 3), False)
Example #3
0
 def test_sub_failedcase_1(self):
     self.assertEqual(subRotate('12673939', 3), True)
Example #4
0
 def test_sub_6(self):
     self.assertEqual(subRotate('123232', 5), True)
Example #5
0
 def test_sub_7(self):
     self.assertEqual(subRotate('3234', 3), False)
Example #6
0
 def test_sub_5(self):
     self.assertEqual(subRotate('12323', 4), True)
Example #7
0
 def test_sub_4(self):
     self.assertEqual(subRotate('1232', 3), True)
Example #8
0
 def test_sub_3(self):
     self.assertEqual(subRotate('132323', 5), True)
Example #9
0
 def test_sub_2(self):
     self.assertEqual(subRotate('13232', 4), True)
Example #10
0
 def test_sub_1(self):
     self.assertEqual(subRotate('1323', 3), True)