Monthly Archives: January 2011
The problem is actually so simple that a brute force approach is possible:
Description You recently befriended a guy who writes software for slot machines. After hanging out with him a bit, you notice that he has a penchant for showing off his knowledge of how the slot machines work. Eventually you get … Continue reading
The problem can be solved using linear algebra. However there’s also a brute force method which is usable for a board with a maximum of 18 columns. Here I’ll describe the brute force approach.
(for the solution see here) Description A simple game consists of a grid of RxC buttons. Each button will be either lighted, or unlighted. Whenever you push a button, the state of that button, and its (up to) four neighbors will … Continue reading
Acknowledgements So this problem seems suite simple. After some thinking I came up with the idea that C(n,k)*(n-k-1)! would give me the number of combinations with exactly k correct wines out of n glasses. Infact C(n,k) is the number of … Continue reading
This problem seems simple. Just store the words in an array of strings and sort them:
At first this problem puzzled me because the example: x.x.x.x.x x…x.x x…x.x.x x.x…x x.x.x.x.x G ‘x’ indicates a peg, ‘.’ indicates empty space. For me gave a solution of 0.63.
This problem seems to have an obvious solution:
Studious Student problem description from Facebook Hacking Cup. Continue reading
(for the solution see here) Description A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 3^2 + 1^2. Your task in this … Continue reading