Question: Zeta | 16th july 2025 | Online Assessments in 16 Jul, 2025 | Cricket Subarrays | Rod Cutting Ways | Roman Numerals | Technical Coding Assessment
0
Entering edit mode

Question 1: Cricket Tournament (Sliding Window Maximum)

Problem Statement:

Due to the rise of covid-19 cases in India, University decided to organize knock-out matches in the Cricket Tournament rather than a league.

Today is the 2nd day of the tournament and the match is between our College and the college who is the winner last year. Raju, the head coach of our College, analyzed the batting stats of the winning college. He has stats of runs scored by all N players in the previous season, which is represented by an array A and he wants to find the maximum score for each and every contiguous subarray of size K in this array A to strategize for the game. Please help him to do so.

Input Format:

  • The first line of input contains two integers N, and K.

  • The second line contains N space-separated integers.

Output Format:

  • Print the maximum score for each and every contiguous sub-list of size K.

Constraints:

  • 1 <= N <=10^6

Question 2: Rod Cutting Combinatorics

Problem Statement:

Given a rod, of length N. You need to cut the rod, into R pieces, such that the length of each piece is non-negative. This means you can cut the rod, with some pieces of length 0 as well. You need to tell, how many ways are there, to do so. Print this answer modulo 1,000,000,007.

Input Format:

  • The first line of input contains a single integer 2T, where T denotes the number of test cases. Note, the number of test cases is T, and we give you the value of 2T.

  • Then, 2*T lines follow, where each pair of lines contain a single integer each, denoting the value of N, followed by the value of R.

Output Format:

  • For each test case, print a single line, containing a single integer, denoting the number of ways of doing the given task, modulo 1,000,000,007.

Constraints:

  • 1 <= T <= 100000

  • 1 <= N, R <= 100000


Question 3: Integer to Roman Numerals

Problem Statement: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

SymbolValue
I1
V5
X10
L50
C100
D500
M1000

 

For example, 2 is written as II in Roman numerals, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.

Roman numerals are usually written from largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:

  • I can be placed before V (5) and X (10) to make 4 and 9.

  • X can be placed before L (50) and C (100) to make 40 and 90. (Note: The prompt cuts off here, but standard logic implies C can be placed before D (500) and M (1000) to make 400 and 900).

Write a function to convert a given integer into its Roman numeral representation.

ADD COMMENTlink 7 hours ago Rohit • 30

Login before adding your answer.

Similar Posts
Loading Similar Posts