Take L to R on number line of positive integers (no array given), find the minimum number of numbers you need from this range to get their XOR = K, else print -1. L,R,K are given in queries.

Constraint : R-L <=10^6

Any approach is much appreciated :) THAnks alot

I can only tell whether answer will be -1 or not ..that also will take

`NlogN`

... commenting for more suggestions .Much appreciated , please share your approach :) Sahilamin219

tfg can you comment?

First of all, why me? Second of all, how many queries. Also, can you please give the problem source? This problem seems too specific for something you came up by yourself.... I have a decent solution but I won't tell if you don't give the source.

I was solving a similar problem...just wondered if this is a new problem. It has no source..just asking for gaining for about this range..query topic :)

Find you many times in comment section helping, so asked you. There's no constraint..its just a discussion problem merely for gaining knowledge :)