there's a couple ways you can do N dimensional keep, some of them better suited for some problems than others, here's some examples
these can all probably be improved and tweaked in different ways to better fit a specific problem, for more information consider joining our discord, linked in uiua.org