Code RoomQuery string encoding
EasyPrep Room Coding #188

Query string encoding

CodingDatabases & SQLNetworking & APIsEntry–Mid~15 min

Build a URL query string from an ordered list of [key, value] pairs. Percent-encode both keys and values so the result is safe for a URL (space becomes %20, reserved characters like & = are escaped), join pairs with '&' and key/value with '='. Preserve the input order. Return an empty string for an empty list.

Implement
build_query(params: list[list[str]]) → str
Examples
in[[["q","hello world"],["lang","en"]]]out"q=hello%20world&lang=en"
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 15 min
InputExpectedGot
[[["q","hello world"],["lang","en"]]]"q=hello%20world&lang=en"not run yetsample