mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Update final char case and unit test for #44.
This commit is contained in:
parent
af2f461239
commit
fe4c118812
|
@ -108,7 +108,7 @@
|
|||
" result += prev_char + (str(count) if count > 1 else '')\n",
|
||||
" prev_char = char\n",
|
||||
" count = 1\n",
|
||||
" result += prev_char + str(count)\n",
|
||||
" result += prev_char + (str(count) if count > 1 else '')\n",
|
||||
" return result if len(result) < len(string) else string"
|
||||
]
|
||||
},
|
||||
|
@ -145,7 +145,7 @@
|
|||
" assert_equal(func(None), None)\n",
|
||||
" assert_equal(func(''), '')\n",
|
||||
" assert_equal(func('AABBCC'), 'AABBCC')\n",
|
||||
" assert_equal(func('AAABCCDDDD'), 'A3BC2D4')\n",
|
||||
" assert_equal(func('AAABCCDDDDE'), 'A3BC2D4E')\n",
|
||||
" print('Success: test_compress')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
|
|
Loading…
Reference in New Issue
Block a user