Professional Documents
Culture Documents
CodeVita 2015 Round 2 PDF
CodeVita 2015 Round 2 PDF
CodeVita 2015 Round 2 PDF
Given text comprising of words and numbers, sort them both in ascending order and print
them in a manner that a word is followed by a number. Words can be in upper or lower
case. You have to convert them into lowercase and then sort and print them.
Input Format:
Words and numbers sorted in ascending order and printed in a manner that a word is
followed by a number.
Constraints:
1. Text starts with a word
2. Count of words and numbers are the same.
3. Duplicate elements are not allowed
4. Words should be printed in lower case.
5. No special characters allowed in text.
2
1 ganesh 12 ramesh 19 sagar 35 sanjay 53
Sagar 35 sanjay 12 ganesH 53 ramesh 19
ganesh 19 lalit 26 rakesh 59 suresh 96
Ganesh 59 suresh 19 rakesh 26 laliT 96
Note:
Please do not use package and namespace in your code. For object oriented languages your
code should be written in one class.
Note:
Participants submitting solutions in C language should not use functions from / as these files
do not exist in gcc
Note:
Problem : MF Tracker
Mani is now curious to find out what was the price of each stock across all funds when he
exited. He wants to do this to find out if his decision to exit the funds based on today's price
was right or wrong. Your task is to help Mani find stock prices when he exited them.
Compute stock prices up to 11 decimal places and print them up to 2 decimal places.
Let's say all funds invested in TCS, Infy and Wipro, then Mani has the following knowledge
Fund 1 -> # of shares of TCS, Infy and Wipro each and overall value of Mani's portfolio
Fund 2 -> # of shares of TCS, Infy and Wipro each and overall value of Mani's portfolio
Fund 3 -> # of shares of TCS, Infy and Wipro each and overall value of Mani's portfolio
Input Format:
Output Format:
Print price of each stock, upto 2 decimal point, on one line (first one on first line, second one
on second line ... Nth one on Nth line). First stock is the one that comes first in the first
tuple. Second stock is the one that comes second in the first tuple. So on and so forth.
OR
3 2600.00
1
10 9 8 56900 2100.00
7 15 9 63200 1500.00
12 8 1 49500
3
2 10 9 8 56900
Unsolvable
20 18 16 113800
30 27 24 170700
Note:
Please do not use package and namespace in your code. For object oriented languages your
code should be written in one class.
Note:
Participants submitting solutions in C language should not use functions from / as these files
do not exist in gcc
Note:
TCS is working on a new project called "TestVita". There are N modules in the project. Each
module (i) has completion time denoted in number of hours (Hi) and may depend on other
modules. If Module x depends on Module y then one needs to complete y before x.
As Project manager, you are asked to deliver the project as early as possible.
Provide an estimation of amount of time required to complete the project.
Input Format:
Output Format:
1
5
15
1
261 16
332
423
513
Explanation:
Please do not use package and namespace in your code. For object oriented languages your
code should be written in one class.
Note:
Participants submitting solutions in C language should not use functions from / as these files
do not exist in gcc
Note:
Input Format:
Constraints:
1. 8 <= N <= 100
Note :
#1 T1-vs-T6 T3-vs-T5
1 8
#2 T7-vs-T4
S1 S2 S5 S4 S3 S1 S6 S6
#3 ... and so on
Explanation:
There are 8 teams with following information:-
Team ID 1 2 3 4 5 6 7 8
State Name S1 S2 S5 S4 S3 S1 S6 S6
Romeo and Juliet stay in Rectanglevilla. As the name suggests, Rectanglevilla is indeed a
rectangle in shape. Romeo's current location is marked by 's'. Juliet's current location is
marked by 'd'. In a difficult hour, Romeo has to ensure that he reaches Juliet via the shortest
path and hence in shortest time.
There are many in Rectanglevilla who are enemies of Romeo and hence will not allow
Romeo to pass through their areas. Romeo must avoid these areas while reaching out for
Juliet. These areas are marked by 'w' character. Areas that Romeo can freely access is
marked by '-' character.
Today Romeo needs your help to reach Juliet via shortest path. Help him.
The input and output specification sections describe how inputs will be provided on console
and how output is expected back on console.
Input Format:
1. First line of input contains grid dimensions delimited by space character
2. Next rows number of lines contain column number of characters
3. Valid characters are {s, d, w, -}, where
a. s represents the location of the Romeo
b. d represents the location of the Juliet
c. w represents inaccessible region
d. - represents accessible region
4. End of input is marked by -1 character
Output Format:
1. Output grid should be of the same dimension as the input grid
2. Output grid should contain path from Romeo's location s to Juliet's location d
3. The 's' character in the grid must be replaced by character 'a' to denote that
Romeo is actively heading towards Juliet.
4. See example section for better understanding
Constraints:
1. It is guaranteed that there will always be exactly one shortest path for Romeo to reach
Juliet
44
w-d- w-d-
1 w-w- waw-
w-ww waww
s--- a---
-1
66
s----w a----w
----w- -a--w-
2 ---w-- --aw--
--w--- --wa--
-w---- -w--a-
w----d w----d
-1
Figure 1.
Note: - The output format shown above is for understanding purpose such that it highlights
the shortest path between Romeo and Juliet. The example in above table depicts output in
text format as you will be required to provide.
Note:
Please do not use package and namespace in your code. For object oriented languages your
code should be written in one class.
Note:
Participants submitting solutions in C language should not use functions from / as these files
do not exist in gcc
Note: