Query string encoding

Write codeEasy15 minStripe style

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]]) -> str
Example 1
Inputbuild_query([["q", "hello world"], ["lang", "en"]])
Output"q=hello%20world&lang=en"