Number from 0 to 9
after receiving a numberYou need to count. (Without count function)
Input value
111222333444567
Output
0 1 2 3 4 5 6 7
0 3 3 3 3 1 1 1
This is how it should be expressed.
python
input = '111222333444567' #Input value
import itertools as it
dict(zip(map(str, range(10)), [0] * 10), **{k: len(list(g)) for k, g in it.groupby(sorted(inputed))})
{'0': 0,
'1': 3,
'2': 3,
'3': 3,
'4': 3,
'5': 1,
'6': 1,
'7': 1,
'8': 0,
'9': 0} #3 is 3. Four is three. Five is one
583 GDB gets version error when attempting to debug with the Presense SDK (IDE)
829 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Uncaught (inpromise) Error on Electron: An object could not be cloned
559 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.