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
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterTests12
Visible tests
Test caché 7
Test caché 8
Test caché 9
Test caché 10
Test caché 11
Test caché 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