Exemple #1
0
def test8():
    string = '(27x12)(20x12)(13x14)(7x10)(1x12)A'
    decompressed_string = decompress_v2(string)
    assert count_letters(decompressed_string) == 241920
    assert decompressed_string == 'A' * 241920
Exemple #2
0
def test9():
    string = '(25x3)(3x3)ABC(2x3)XY(5x2)PQRSTX(18x9)(3x2)TWO(5x7)SEVEN'
    decompressed_string = decompress_v2(string)
    assert count_letters(decompressed_string) == 445
Exemple #3
0
def test7():
    string = 'X(8x2)(3x3)ABCY'
    decompressed_string = decompress_v2(string)
    assert count_letters(decompressed_string) == len('XABCABCABCABCABCABCY')
    assert decompressed_string == 'XABCABCABCABCABCABCY'
Exemple #4
0
def test0():
    string = 'ADVENT'
    decompressed_string = decompress(string)
    assert count_letters(decompressed_string) == 6
    assert decompressed_string == 'ADVENT'
Exemple #5
0
def test6():
    string = '(3x3)XYZ'
    decompressed_string = decompress_v2(string)
    assert count_letters(decompressed_string) == 9
    assert decompressed_string == 'XYZXYZXYZ'
Exemple #6
0
def test5():
    string = 'X(8x2)(3x3)ABCY'
    decompressed_string = decompress(string)
    assert count_letters(decompressed_string) == 18
    assert decompressed_string == 'X(3x3)ABC(3x3)ABCY'
Exemple #7
0
def test4():
    string = '(6x1)(1x3)A'
    decompressed_string = decompress(string)
    assert count_letters(decompressed_string) == 6
    assert decompressed_string == '(1x3)A'
Exemple #8
0
def test3():
    string = 'A(2x2)BCD(2x2)EFG'
    decompressed_string = decompress(string)
    assert count_letters(decompressed_string) == 11
    assert decompressed_string == 'ABCBCDEFEFG'
Exemple #9
0
def test1():
    string = 'A(1x5)BC'
    decompressed_string = decompress(string)
    assert count_letters(decompressed_string) == 7
    assert decompressed_string == 'ABBBBBC'