I need to convert an array like the following:

```js
["Cats", "Cats", "Dogs", "Dogs", "Dogs"]

```

the the following form:

```js
[
    { x: "Cats", y: 35 },
    { x: "Dogs", y: 40 },
    { x: "Birds", y: 55 },
]

```

where `y` represents the number of the same elements in the array.