Google Online Coding Challenge (Online Test) SWE INTERN 2021
Anonymous User
1322

About a week ago, i received mail from google regarding coding round.
Today the test was conducted on HackerEarth platform.

It had two questions:-

1. Given an array of size N. Modify each element of array to greatest prime number less than or equal to A[i] or smallest prime number greater than or equal to A[i].
Note: If A[i] is prime we should not modfiy it.
By doing above operations, return the longest increasing subsequence of the array.

2. Given an array of size N. You are allowed to perform the following operation at most K
times:
In one operation, you can increment an array eleemnt by one.

You can perform increment operation on same index more than once. You are required to find maximum size subarray of equal elements.

Output:
Return length of the maximum size subarray of equal elements.

I'm actually beginner so wasn't able to do any of these two.
I have implemented Longest Increasing Subsequence simply, but prime numbers got me a tough time. and in question 2 I had no idea.

Can anyone help me with these questions?
Also any suggestive topic I should more focus on?

Comments (2)