Internship Opportunity


Hatua Solutions Ltd has an internship opportunity for interested students during this long vacation. Interested students should complete the assignment below and send the solution together with all requirements to the email address stated below.

SIMPLE OR TRUMP

Challenge Description:

First playing cards were invented in Eastern Asia and then spread all over the world taking different forms and appearance. In India, playing cards were round, and they were called Ganjifa. In medieval Japan, there was a popular Uta-garuta game, in which shell mussels were used instead of playing cards.

In our game, we use playing cards that are more familiar nowadays. The rules are also simple: an ace beats a deuce (2) unless it is a trump deuce.

Input sample:

AD 2H | H
KD KH | C
JH 10S | C

The first argument is a path to a file. Each line includes a test case which contains two playing cards and a trump suit. Cards and a trump suite are separated by a pipeline (|). The card deck includes thirteen ranks (from a deuce to an ace) of each of the four suits: clubs (♣), diamonds (♦), hearts (♥), and spades (♠). There are no Jokers.

Output sample:

2H
KD KH
JH

Your task is to print a card that wins. If there is no trump card, then the higher card wins. If the cards are equal, then print both cards.

Constraints:

The card deck includes ranks from a deuce (2) to an ace, no Jokers. If the cards are equal, then print both cards.
The number of test cases is 40.

Code Submission:

The source can be in any of the stated programing languages Vb.Net, C#, Delphi, Pascal, C Side/ C AL, Java, C++, PHP, Python. Preferable C#, Java, Vb.Net.

The complete source code must be sent to careers@hatuasolutions.com in a zip file. (Stating the name and school).

Code submission must be sent before April 30, 2016.

CODE COMBINATIONS

Challenge Description:

You definitely know the game where you have to make as many words from the given letters as possible. In our case, the rules are a bit different: you need to check whether it is possible to make the word ‘code’ with the four given letters, and, if possible, count how many times you can do this. Letters can be in a various order.

Solution example:

|****|

|*co*| |co| = 1

|*de*| |de|

Input sample:

**** | *co* | *de* | ****

codx | decx

co | dx

The first argument is a path to a file. Each line includes a test case with symbol matrix. Each line of the matrix is separated by a pipeline ‘|’.

Output sample:

1

2

0

You need to calculate and print a number that will tell how many times you can make the word ‘code’ from the letters in the matrix, using a 2×2 submatrix.

Constraints:

The number of rows or columns in the matrix can be from 2 to 10. Matrix can include one face for 2 solutions in case.

|codx| |co| |od| = 2

|decx| |de| |ec| The number of test cases is 40.

Code Submission

The source can be in any of the stated programing languages Vb.Net, C#, Delphi, Pascal, C Side/ C AL, Java, C++, PHP, Python. Preferable C#, Java, Vb.Net.

The complete source code must be sent to careers@hatuasolutions.com in a zip file. (Stating the name and school).

Code submission must be sent before April 30, 2016.