Monthly Archives: October 2010

Ramu Kaka’s Puzzle

Ramu Kaka is back home from his visits now. While cleaning the store room of his master, he came across a puzzle. The puzzle consists of a 5×5 frame containing 24 small identical squares. Each square has a unique number … Continue reading

Posted in Information Technology | Leave a comment

Chatruka’s Algorithm

Chatruka prefers writing messages in short form. This often creates problem for others to decipher the correct message leading to mismanagement in his kingdom. After several discussion with his advisory board, he finally adopted a method to send his message … Continue reading

Posted in Information Technology | Leave a comment

While loop in SQL Server

DECLARE @count int SELECT @count = 0 WHILE @count < 10000 BEGIN SELECT @count=@count+1 delete top (1000) from eventinfo PRINT ‘The Value of @count is: ‘ + CAST(@count AS VARCHAR(5)) END

Posted in Information Technology | Leave a comment

Directory Path Parsing

using System; using System.Collections.Generic; using System.Text; using System.Collections; using System.Text.RegularExpressions;   namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             string directoryPath = @"C:\a\b\c\..\.\..\g\.";             //Expected Output = "C:\a\g             List<string> folderStack = … Continue reading

Posted in Information Technology | Leave a comment

Prime Factors

Webster defines prime as: prime () n. [ME, fr. MF, fem. of prin first, L primus; akin to L prior] 1 : first in time; original 2 a : having no factor except itself and one ❤ is a ~ … Continue reading

Posted in Information Technology | Leave a comment

Alternating Letters

On the long long road to Mordor, Sam and Frodo get to talking . . . Sam: “Mr. Frodo, I am quite exasperated with our situation.” Frodo: “Sam, that is an interesting choice of words. Note that in the word … Continue reading

Posted in Information Technology | Leave a comment

Distinct pair of numbers from an integer array whose product is equal to a given number

using System; using System.Collections.Generic; using System.Text; using System.Collections;   namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             int[] numArray = { 1, 1, 2, 2, 0, 3, 2, 2, 6, 6, 1, … Continue reading

Posted in Information Technology | Leave a comment