Google online Coding Challenge | 26/09/2020
Anonymous User
583

Two coding questions | 60 minutes
Question 1:
image
image
Question 2 :
image
image
image

I figured out a O(n^2) approach for question 1 but didn't implement as i knew that would give TLE.
All the numbers greater than/equal to (a-1)* a can be formed by a and a+1. However a linear solution is expected as seen from the constraints.
Please help me with the intuition/hint to solve the first one.

Spent a lot of time on question 1 and didn't even try the question 2.

Comments (3)