Write a function that groups words by the number of capital letters and returns an array of object entries whose keys are the number of capital letters and the values are the groups.
grouping(["HaPPy", "mOOdy", "yummy", "mayBE"]) ➞ [
[0, ["yummy"]],
[2, ["mayBE", "mOOdy"]],
[3, ["HaPPy"]]
]
grouping(["eeny", "meeny", "miny", "moe"]) ➞ [
[0, ["eeny", "meeny", "miny", "moe"]]
]
grouping(["FORe", "MoR", "bOR", "tOR", "sOr", "lor"]) ➞ [
[0, ["lor"]],
[1, ["sOr"]],
[2, ["bOR", "MoR", "tOR"]],
[3, ["FORe"]]
]