input: Write a function to parse a json-formatted string into a dictionary. The function should take a single argument which is the json-formatted string and return the dictionary representation of it. If the input string is not a valid json, the function should raise a ValueError.
  
  Code:
  
  import json
  
  def parse_json_to_dict(json_str):
      try:
          return json.loads(json_str)
      except json.JSONDecodeError:
          raise ValueError("Invalid JSON string")
  
  assert parse_json_to_dict('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}') == {'name': 'John', 'age': 30, 'address': {'city': 'New York', 'state': 'NY'}}
  assert parse_json_to_dict('{"name": "Alice","age": 25,"address": {"city": "Los Angeles","state": "CA"}}') == {'name': 'Alice', 'age': 25, 'address': {'city': 'Los Angeles', 'state': 'CA'}}
  assert parse_json_to_dict('{"name": "Bob","age": 22}') == {'name': 'Bob', 'age': 22}
  assert parse_json_to_dict('{"name": "Charlie","age": 35,"address": {"city": "Chicago","state": "IL"}}') == {'name': 'Charlie', 'age': 35, 'address': {'city': 'Chicago', 'state': 'IL'}}
  assert parse_json_to_dict('invalid json string') == ValueError("Invalid JSON string")
  
output: import json
  
  def parse_json_to_dict(json_str):
      try:
          return json.loads(json_str)
      except json.JSONDecodeError:
          raise ValueError("Invalid JSON string")