Friday, October 17, 2008

Christmas list ideas

I know Christmas is still 2 months and 8 days away, but I was at a store and they already have the fake Christmas trees up with quite a few aisles already stocked with Christmas items. Normally I wouldn't start thinking about Christmas shopping but today I heard about the best Christmas present EVER! (Steak may try to find something, but this is at least a top ten idea.) What could be better than an exercise DVD to learn Judo? Maybe an exercise DVD teaching you Judo by the one and only Vladimir Putin! I'm not sure if it's available in the US, so people may need to wait. You could just give your loved one an IOU one Vladamir Putin Judo DVD. It will truly make anyone's Christmas a special Christmas.

In case you missed it, I did at least, here is John McCain at the Al Smith dinner.


Also, in xkcd today, they came really close to getting Kayleen down. Her morning routine is 1, 3, 2.

Also, Ryan got the riddle correct. The way I answered was basically the same, but I wasted more power by turning on two lights, waiting some amount of time then turning one off.

I had a phone interview with a company yesterday and they asked me this question, let's say you have an array of n numbers. In the array of numbers, you have all the numbers from 1 to n-1 in the array plus one number is repeated. How would you find the number that is repeated? An example of what an array of numbers would look like, if you had an array of 10, the array could look like this.
[1, 6, 3, 2, 4, 7, 8, 9, 5, 2]
So the answer here would be two.

3 comments:

Ry Guy said...

I would use some sort of algorithm. But the key is to use a GOOD algorithm. Some people try to find repeated numbers using crappy algorithms, and those NEVER work.

Picky Bear said...

You are supposed to give an idea of your algorithm. Actually, the way the guy I talked to did it didn't use a searching algorithm. Since you know that you have the numbers from 1 to (n-1), you can use that knowledge. You use the math algorithm that tells you the sum from 1 to (n-1) and then you go through your array and add up all of the numbers. You then take that number minus the sum of 1 to (n-1) and you'll have your answer.

Ry Guy said...

Duh. Like i already said: use a GOOD algorithm.