Hackerrank 101oct Halloween party

PROBLEM STATEMENT:

You are given a very large rectangular chocolate bar. You must cut only as 1 x 1 pieces. You are allowed to do only ‘K’ cuts at the maximum. What is maximum number of chocolate pieces can u cut ?

For a detailed problem statement click here

Continue reading

Topcoder SRM 595 DIV2 250

Problem Statement

In short, You are given a string containing only characters R,G,B. We can remove the string from either end at each move( from left or from right). Finally, the string must contain only R or G or B.

You can find a detailed problem description here.

Continue reading

CODECHEF COOK38 RRMATRIX

Problem Statement

Let ‘A’ be a R x C  Matrix. Elements in ‘A’ are filled from 1 to R*C in row-major order. ‘B’ is also a R x C Matrix where the elements are filled in column-major order.

Find number of cells which satisfy the property Ai,j ==  Bi,j.

For a brief problem statement click here.

Continue reading

Topcoder SRM 594 DIV2 250

Problem Statement

In a nutshell, Given a M x N Matrix we have to check whether it is possible to visit all the cells starting from any location.

Moving Direction – If you are in the cell (x,y), you can only move to ( (x+1)%M, (y+1)%N )

You can find a detailed problem description here.

Continue reading

Pop Vs Imap Protocol

Both POP3 and IMAP protocol are used for email retrieval process.

Pop Protocol

  • Pop protocol downloads the mail from the server, stores it locally and deletes from the server.
  • POP3 is useful only when you access email from only one computer.
  • POP3 is a one-way communication.
  • All mails are stored locally and without internet connection we can access them.
  • When the mail is accidentally deleted, we cannot recover it.

IMAP Protocol

  • IMAP protocol connects the remote server, caches the mail locally and then disconnects from the server.
  • IMAP is useful when you want access e-mail from multiple systems.
  • IMAP is a 2-way communication

Puzzle – A Bird and Two Trains

Puzzle

Consider two trains starting from two points X and Y respectively. Trains which starts from X travels at 15 Km/hr while the train which starts from Y travels at 20 Km/hr. Both trains start at the same time. A Bird also start from X at the same time. The speed of the Bird is 25 Km/hr. The Bird flies from X to Y until it meets the train started from Y. After that it changes its direction and fly towards the train started from X. When it meets X it start flying toward Y and so on until the train meets. What is the total distance covered by the bird ?

Hint : Think Simple !

Continue reading