Monthly Archives: October 2009

BOB Number

Little Bob loves to play with numbers. Recently he came up with a new series of numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for digitadition, … Continue reading

Posted in Information Technology | Leave a comment

Google Sorry Page

Posted in Information Technology | Leave a comment

Greater of two numbers using sql query

DECLARE @n1 INT, @n2 INT SELECT @n1 = 5, @n2 = 10 select case when @n1 > @n2 then @n1 else @n2 end as "MAX"

Posted in Information Technology | Leave a comment

Hamming Distance

The Hamming distance between two strings of equal length is the number of positions for which the corresponding symbols are different. If we take it in another way, then it is the minimum number of substitutions required to convert one … Continue reading

Posted in Information Technology | Leave a comment

Help Schumacher!

Good News… Schumi’s Comin’ back to Formula One!!! As we all know, Michael Schumacher will be making his grand comeback on 23rd August. Now, Schumi needs to strategize his next race in Valencia, Spain. And guess what… Schumi will need … Continue reading

Posted in Information Technology | Leave a comment

Minimal Swap

You are given an N x N matrix. The chips are represented by B and R. You can swap any two adjacent rows of the matrix. Your goal is to have all the black chips in the matrix below or … Continue reading

Posted in Information Technology | Leave a comment

Even or Odd

using System; using System.Collections.Generic; using System.Text;   namespace EvenOdd {     class EvenOdd     {         static void Main(string[] args)         {             try             {                 string str = "123477756780 432134567789555";                 int digit1 = 0, digit2 = 0, … Continue reading

Posted in Information Technology | Leave a comment