The problem
I tried writing a generator script but that didn't help.
Submission Link.
Code explanation: In the problem, we are given an array/list and we have to check if we can form 1 square and 1 rectangle with those elements(planks). Only possible values are 8, 6 6, 6 2, 4 4, 4 2 2. I tried to count the numbers of 2s, 4s, 6s and 8s. And with every query, their value is incremented or decremented. In the end, I check if the values form any of the possible values and print Yes or No according to it. If anything is greater than 8 then I count it as 8.
Edit: I was missing 6 4 in my possible values. Accepted Solution.
Can u explain the problem & your solution?
In the problem we are given an array/list and we have to check if we can form 1 square and 1 rectangle with those elements(planks). Only possible values are 8, 6 6, 6 2, 4 4, 4 2 2. I tried to count the numbers of 2s, 4s, 6s and 8s. And with every query, their value is incremented or decremented. In the end I check if the values form any of the possible values and print Yes or No according to it.
what if something is 17 times not 2, 4, 6, 8 times in the array.
There is also a case when two >= 4
But that will not form a square, we need a minimum of 4.
Ah, forgot this Anyway, you can also construct it with sixes and fours