https://hack.codingblocks.com/app/practice/3/542/problem
sir not able to understand this problem.Please help
https://hack.codingblocks.com/app/practice/3/542/problem
sir not able to understand this problem.Please help
Hi Aditi
In this question a string will be given for each testcase; corresponding to it q queries will also be given. Now in each of these q queries 2 numbers l and r will be given which define the range of the substring to be processed by this query. Now you have to find the beauty of this substring where beauty is the XOR of frequencies of the elements in the substring. This means that XOR is not to be taken of the elements but of their frequencies
For example:-
Hello World
2
1 5
3 7
Here the string is “Hello World”, 2 queries have been given, first from position 1 to position 5 which is substring "ello " and second from 3 to 7 which is “lo Wo”. Frequencies are e - 1 l - 2 o - 1and space -1 hence xor of 1,2,1,1 which is 3 similarly for “lo Wo” you can find yourself(again 3)
thank You