This zip file contains a Python solution & an Excel solution to the permutation problem of determining how many different ways a certain number of people can stand in a line so you can see an exact number of them.
For instance, if you have 8 people in a line, how many ways can they stand so that you can see exactly 5 of them, assuming that you can't see anyone who has a taller person standing anywhere in front of them.
That turns out to be a challenging permutation problem, and problems like it frequently show up in different programming challenges. The standard permutation problem is insufficient to solve it, a more elegant approach must be used.
The Excel solution contains a table with a bottoms up solution to the problem. The python program solves it 3 ways, one replicating the bottoms up method, one with a top down recursive method, and one with a naive brute force method that quickly collapses for the larger problems.