For 3rd qs. If my array is something like 1 1 2 2 Nd my query is 1 4 Ans as per ur idea is yes But it doesn't follow for every cyclic rotation right. Am i missing something
@@kondekarvaishnavi2348 Rearrange means you can shuffle in any order. In the question it is asked, that you can shuffle the array in any way, so that you obtain a rearrangement, which is *anti-palindrome for all its cyclic shifts.* So 1st you have to rearrange.. then, check if that rearrangement gives anti-palindrome even after cyclic shifts.. I hope you got it.
in the third question u have said array is beautiful if all the cyclic rotation is should be anti-palin but if it so then the approach will wail in this 4 2,3,3,1 ans is yes how ? a[1]=a[2] so it is not beautiful
Please fill the Feedback form for PCD: forms.gle/khJnidNRCZCbDjjY9
3rd question the way you explained was amazing man
well explained . Thank you bro
Thnks bro 4th explanation is great
well explained
For 3rd qs.
If my array is something like 1 1 2 2
Nd my query is 1 4
Ans as per ur idea is yes
But it doesn't follow for every cyclic rotation right. Am i missing something
You can rearrange it like,
1 2 1 2
Now, this is anti-palindrome for all cyclic shifts.
@@abhinavkumariitism rearrange mean we can shuffle them as per any order or we can rearrange them only by shifts
@@abhinavkumariitism rearrange mean we can shuffle them as per any order or we can rearrange them only by shifts
@@kondekarvaishnavi2348
Rearrange means you can shuffle in any order.
In the question it is asked, that you can shuffle the array in any way, so that you obtain a rearrangement, which is *anti-palindrome for all its cyclic shifts.*
So 1st you have to rearrange.. then, check if that rearrangement gives anti-palindrome even after cyclic shifts..
I hope you got it.
in the third question u have said array is beautiful if all the cyclic rotation is should be anti-palin but if it so then
the approach will wail in this
4
2,3,3,1
ans is yes how ?
a[1]=a[2] so it is not beautiful
bcoz we are allowed to rearrange the elements, [2,3,1,3] will be beautiful by rearranging the original array
You can rearrange it like this,
3,2,3,1
Then, in this case all the cyclic shifts are anti-palindrome, so it is beautiful.
@@abhinavkumariitism ok thanks it is then quite easy