Curious if this problem can be solved more elegantly (maybe using recursion?)
I’m a graduate student in biology that encountered a problem that I really struggled solving in my project. I solved it using an iterative approach (will describe more below) but was curious if there was a simpler or more elegant solutions to this.