How about not fiddling with indices?
JQ Notfiddlingwithindexification
https://github.com/zogwarg/advent-of-code/blob/main/2023/jq/14-a.jq
#!/usr/bin/env jq -n -R -f
# Dish to grid
[ inputs / "" ]
# Tilt UP
| transpose # Transpose, for easier RE use
| map( #
("#" + add) | [ # For each column, replace '^' with '#'
scan("#[O.]*") | [ # From '#' get empty spaces and 'O' rocks
"#", scan("O"), scan("\\.") # Let gravity do it's work.
] #
] | add[1:] # Add groups back together
) #
| transpose # Transpose back
# For each row, count 'O' rocks
| map(add | [scan("O")] | length)
# Add total load on "N" beam
| [0] + reverse | to_entries
| map( .key * .value ) | add
Similarly tired with index fiddling, I was pretty happy with my approach, which led to satisfying transpose
cancelling in part 2. Not the fastest code out there, but it works. Day 14 was actually my favorite one so far ^^.
Vigorous mask-dropping very early on in the post:
Not all dating is done with reproduction in mind. What are members of the opposite, or indeed same gender: baby synthesis apparatus? Unless you go out of your way in selecting blue eyed, blond haired people, restricting the definition of beautiful to these people, and restricting the teleology of tinder to the begetting progeny, how is it even remotely eugenics?
EDIT: Uncharacteristically for LW the post, was very short short, "very early" is actually about midway in a proposal of little substance, also choosing attractive partners doesn't guarantee ensure children anyway (unless using very specific definitions of beauty).