I have a Ruby hash that I need to convert to another format. 
Considering that the 'array' size is unknown/unlimited, how would you 'flatten' this hash into the desired format?

Original Hash

```
{
  :parameters => {
    :'userResponse.objectInstanceType' => 'QuesAnsResponse',
    :'userResponse.quesAnsDetailArray' => {
      :'0' => {
        '.answer'=> 'Texas'
      },
      :'1' => {
        '.answer' => 'w3schools'
      }
    }
  }
}

```

Desired Format:

```
{
  :parameters => {
    :'userResponse.objectInstanceType' => 'QuestionAnsResponse',
    :'userResponse.quesAnsDetailArray[0].answer' => 'Texas',    
    :'userResponse.quesAnsDetailArray[1].answer' => 'w3schools'
  }
}

```