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
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

Tests12
Visible tests
Skrytý test 7
Skrytý test 8
Skrytý test 9
Skrytý test 10
Skrytý test 11
Skrytý 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