Tip 1: Participate in contests daily.
Tip 2: Upsolve problems that you couldn’t solve during the contest.
Tip 3: Practice coding platform problems topic-wise.
Tip 1: Have projects that align with the company's JD.
Tip 2: Highlight achievements, if any.



I brute-forced this problem by iterating through all the numbers and checking if each one is a palindrome. This led to 11 out of 16 test cases passing. I was only able to solve it partially.



Rectangles = [[0, 0, 2, 2], [1, 0, 2, 3],[1, 0, 3, 1]],
For the given three rectangles, you can observe that the first rectangle occupies an area of 4 units and the second rectangle has an area of 3 units, but we have to keep one thing also in mind that they have an area of 3 units common overlapping among them, so we cannot include it again, so the final area which comes out for all the rectangles is 6 units.
Total Area = 6 units

I used coordinate compression and was then able to solve it.


‘N’ = 4, and ‘ARR’ = [2, 3, 4, 2]
For a triangle, the largest side should be strictly less than the sum of the other two sides. The triplet [2, 2, 4] cannot form a triangle as ‘4 = 2 + 2’. Here, two valid triangles can be formed, having sides as:
1. [2, 3, 4], with perimeter ‘9’.
2. [2, 2, 3], with perimeter ‘7’.
So, you should return ‘9’ as the answer.
The array ‘ARR’ contains at least three integers, i.e., ‘N >= 3’.
I knew that it had to be approached using DP. The idea was to use the length of the largest triangle with the bottom pixel at the (i−1, j−1) cell, i.e., dp[i−1][j−1], along with the length of the longest contiguous array of 1s in the i-th row. However, I was too late to come up with this approach and could not implement it.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What does the SQL function NOW() return?