r/CodingContests • • Feb 03 '11

Al Zimmerman programming challenge - arranging a deck of cards (with prizes!)

http://azspcs.net/Contest/Cards
3 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/AlexFromOmaha Feb 03 '11

Sure, and that works great when you can eyeball the correct answer. It's irrelevant when you don't know what the answer is. To solve for 97 from a purely naive standpoint, the worst case is moving on average half of the elements in a 97 element array some unknown (but large) number of times over 97! iterations. Not gonna happen. Needs somethin' better.

1

u/Porges Feb 04 '11 edited Feb 04 '11

I was suggesting that f(x) = Fib(x)-1 :)

It is, of course, wrong.