Recently took the Citadel Securities Online Assessment. Sharing the two coding questions (paraphrased).
You are given two integers, processes (the total number of available processes) and intervals (the total number of time slots).
You need to schedule the processes into the given time intervals such that no single process occupies consecutive time slots. Assume all processes are never-ending and can be scheduled infinitely.
Determine the total number of valid ways to schedule the processes. Since the result can be very large, return it modulo .
Constraints
You are given an integer array of length n and an integer maxValue.
You can modify any element in the array to any integer less than or equal to maxValue.
Each modification costs unit. Your objective is to select a number from the array (after any necessary modifications) that is co-prime (greatest common divisor is ) with all other elements in the array.
Calculate the score defined as:
score = (selected number) - (total modification cost)
Return the maximum possible score.
Constraints