Does anyone here have the round 1 questions of CodeVita 2017 season VI (zone 3)? If yes then please do share. The round was conducted between 3:00 pm 28 July 2017 and 3:00 pm 29 July 2017.
Here are TCS CodeVita 2017 Round 1 Questions :- http://virtualoops.com/tcs-codevita-2017-round-1-questions/
Problem : Mountain peak sequence
Consider the first three natural numbers 1, 2, 3. These can be arranged in the following ways: 2, 3, 1 and 1, 3, 2. Inboth of these
arrangements, the numbers increase to a certain point and then decrease. A sequence with this property is called a “mountain
Given an integer N, write a program to find the remainder of mountain peak arrangements that can be obtained by rearranging the
numbers 1, 2, …, N.
One line containing the integer N
An integer m, giving the remainder of the number of mountain peak arrangements that could be obtained from 1, 2, …, N is divide
Mod = 10 9 +7
N ≤ 10 9
There are two such arrangements: 1, 3, 2 and 2, 3, 1
The six arrangements are (1, 2, 4, 3), (1,3,4,2), (1,4,3,2), (2,3,4,1), (2,4,3,1), (3,4,2,1)
Please do not use package and namespace in your code. For object oriented languages your code should be written in one class.
Participants submitting solutions in C language should not use functions from <conio.h> / <process.h> as these files do not exist
For C and C++, return type of main() function should be int.
Here is the link to my drive.
You can find solution of some of the questions which I attempted.