devrel

Cat pics challenge

You have a JSON dataset of cat pictures, each with a file name, dimensions and alternative text that starts with the name of the cat and a description of what it looks like.

Write a solution that shows:

For example, if the dataset were to be:

[
    {
        "width":200,"height":300,
        "filename":"5klvugfffl.gif",
        "alt":"Whiskers: ginger cat."
    },
    {
        "width":800,"height":600,
        "filename":"fpocczf87fl.jpg",
        "alt":"Bootsy: grey cat."
    },
    {
        "width":400,"height":900,
        "filename":"5pocczf87fl.jpg",
        "alt":"Whiskers: white cat."
    },
    {
        "width":200,"height":300,
        "filename":"5k9kof87fl.webp",
        "alt":"Mortimer: tabby cat."
    }
]

The result you should create is:

{
  uniquenames: 3,
  widest: 800,
  tallest: 900,
  formats: { gif: 1, jpg: 2, webp: 1 }
}