Match URL paths against route patterns with :param placeholders.
solve(routes, path) returns { pattern, params } for the first matching
route, or null if none.
E.g. routes ['/users/:id', '/posts/:slug/comments/:cid'], path /users/42
→ { pattern: '/users/:id', params: { id: '42' } }.
Sample tests