Round 1
Questions: You are given an array A of size N. You have to find the number of quadruplets based on certain conditions:
- A[i] × A[j] = A[k] × A[l]
- i < j < k < l
Bruteforce Approach: Run 4 loops and every time check the above condition. Whenever the condition is true, simply increment the count value.
- Time Complexity: O(N^4)
This solution will surely give TLE error but pass some test cases.
Efficient Approach given below:
Efficient Approach
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.