Config String Parser
Configs are often stored as one compact string, with key-value pairs separated by delimiters. Given a string s in a format like a=1;b=2;c=3, return a dictionary with string keys and string values. Ignore empty segments. If the same key appears more than once, keep the last value.
Примеры
Ввод
"a=1;b=2;c=3"Вывод
{"a": "1", "b": "2", "c": "3"}Ввод
""Вывод
{}Ввод
"x=10;;y=20"Вывод
{"x": "10", "y": "20"}Нужно реализовать
def parse_config(s):
Теги
stringsdicthashmap
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inTests12
Visible tests
Hidden test 7
Hidden test 8
Hidden test 9
Hidden test 10
Hidden test 11
Hidden test 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid