mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-07 09:58:03 +00:00
Update final char case and unit test for #44.
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user