input: Write a function to parse a json-formatted string into a python dictionary. The function should return the parsed dictionary or None if the input is not a valid json string.
  assert parse_json('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}
  assert parse_json('invalid json')==None
  assert parse_json('[]')==[]
  assert parse_json('{}')=={}
  assert parse_json('')==None
output: try:
      import json
      return json.loads(s)
  except (json.JSONDecodeError, TypeError):
      return None