# [J], 19 bytes

    1#.'1'=[":@}.i.@],]

[Try it online!][TIO-kdk83yra]

[J]: http://jsoftware.com/
[TIO-kdk83yra]: https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DZX11A3VbaOVrBxq9TL1HGJ1Yv9rcilwpSZn5CsoKBgqaFhbp2kqGBoYQIUMYUJGMCFDI2OokJm5xX8A "J – Try It Online"