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
Prijavi se da vidiš povijest predaja
PrijavaPrijavi se da koristiš AI mentora
PrijavaTests12
Visible tests
Skriveni test 7
Skriveni test 8
Skriveni test 9
Skriveni test 10
Skriveni test 11
Skriveni 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