15
1
We have 40 sticks of same widths but different heights. How many arrangements are there possible to put them next to each other so that when we look from right we see 10 sticks and when we look from left we again see exactly 10 sticks?
For example such an ordering is:
Black sticks are hidden, red sticks are the ones you can see when you look from left, the blue sticks are the ones you can see when you look from right and purple one(i.e. the longest one) is the one that can be see seen from both sides.
As test cases:
- If we had 3 sticks number of orderings to see 2 from left and 2 from right is 2
- If we had 5 sticks number of orderings to see 3 from left and 3 from right is 6
- If we had 10 sticks number of orderings to see 4 from left and 4 from right is 90720
13You might want to avoid questions with a fixed output because the optimal code-golf answer will probably just print the result without calculating it. I'd recommend making the question have a few variable inputs, eg N sticks such that you see K of them from left/right, where N and K are input integers – Sp3000 – 2015-05-12T07:18:27.740
4If you do change the spec so that programs take in input (I don't see why not - you already have the test cases), you might want to think about whether or not you want to put a time limit on programs. – Sp3000 – 2015-05-12T07:24:31.897
1"Must use your posted program to calculate the 40/10 case" should be a good enough time limit. – feersum – 2015-05-12T08:50:13.887
1I can't get over the fact that
10!/40 = 90720
... is that coincidence? – Tim – 2015-05-12T15:48:26.7601
@Tim Whats the significance of 90720? Zip code for Los Alamitos, CA?
– Digital Trauma – 2015-05-12T18:16:07.897@DigitalTrauma no, that is the orderings for 10 with 4 from each side. – Tim – 2015-05-12T18:17:02.037