You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a number n and two positions l and r. Your task is to toggle all bits from lth bit to the rth bit of the number n (inclusive l and r with 0 based indexing on 64-bit machine where integer takes 4 bytes).
*/
class Result {
static int toggleRangeBits(int num, int l, int r) {