Query string encoding
Your task
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.
Examples
build_query(params: list[list[str]]) -> strExample 1
Input
build_query([["q", "hello world"], ["lang", "en"]])Output
"q=hello%20world&lang=en"