Write a function to parse a JSON payload and extract specific features.
Implement parse_features(payload, paths), where payload is a valid JSON string and paths contains dot-separated paths. Return a dictionary mapping each path to its value when the path exists; omit missing paths. Object keys and zero-based array indices may appear in a path, such as user.profile.name or items.0.id.
payload is a valid JSON string.def parse_features(payload, paths):