## Write your own strcmp that ignores cases

Write a modified strcmp function which ignores cases and returns -1 if s1 < s2, 0 if s1 = s2, else returns 1. For example,… Read More »

- Find XOR of all elements in an Array
- Count of subarrays of an Array having all unique digits
- Check if a Number is Odd or Even using Bitwise Operators
- Bitwise AND of all the elements of array
- Count number of binary strings without consecutive 1’s : Set 2
- Program to find the Nth natural number with exactly two bits set
- XOR of every element of an Array with a given number K
- Partition of a set into K subsets with equal sum using BitMask and DP
- XOR of elements in a given range with updates using Fenwick Tree
- Bitwise XOR of a Binary array
- Count maximum occurrence of subsequence in string such that indices in subsequence is in A.P.
- Find a Mother vertex in a Graph using Bit Masking
- Count of pairs whose bitwise AND is a power of 2
- Check if left and right shift of any string results into given string
- Count subarrays with sum equal to its XOR value
- Number of subsets with same AND, OR and XOR values in an Array
- Maximum number of set bits count in a K-size substring of a Binary String
- Largest number in the Array having frequency same as value
- Find the largest number smaller than integer N with maximum number of set bits
- Count of binary strings of length N having equal count of 0's and 1's
- Find a number such that maximum in array is minimum possible after XOR
- XOR of pairwise sum of every unordered pairs in an array
- Count of subarrays of size K with elements having even frequencies
- Bitwise operations on Subarrays of size K
- Remove all even parity nodes from a Doubly and Circular Singly Linked List
- Maximum weighted edge in path between two nodes in an N-ary tree using binary lifting
- Sum of bit differences for numbers from 0 to N
- Find the remainder when N is divided by 4 using Bitwise AND operator
- Turn off the rightmost set bit | Set 2
- Find the length of the Largest subset such that all elements are Pairwise Coprime

Write a modified strcmp function which ignores cases and returns -1 if s1 < s2, 0 if s1 = s2, else returns 1. For example,… Read More »

Write a program to print Binary representation of a given number. Recommended: Please solve it on “PRACTICE” first, before moving on to the solution. Source:… Read More »

Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once. Expected time complexity… Read More »

Given two signed integers, write a function that returns true if the signs of given integers are different, otherwise false. For example, the function should… Read More »

Given a positive integer n, count the total number of set bits in binary representation of all numbers from 1 to n. Examples: Input: n… Read More »

In computer science and mathematics, the Josephus Problem (or Josephus permutation) is a theoretical problem. Following is the problem statement: There are n people standing… Read More »

Given a number x and two positions (from the right side) in the binary representation of x, write a function that swaps n bits at… Read More »

Write a function Add() that returns sum of two integers. The function should not use any of the arithmetic operators (+, ++, –, -, ..… Read More »

Write a program to find the smallest of three integers, without using any of the comparison operators. Let 3 input numbers be x, y and… Read More »

Input: A array arr[] of two elements having value 0 and 1 Output: Make both elements 0. Specifications: Following are the specifications to follow. 1)… Read More »

Given an integer array of length N (an arbitrarily large number). How to count number of set bits in the array? The simple approach would be, create… Read More »

Given a number x, find next number with same number of 1 bits in it’s binary representation. For example, consider x = 12, whose binary… Read More »

Modulus operator is costly. The modulus operator (%) in various languages is costly operation. Ultimately every operator/operation must result in processor instructions. Some processors won’t… Read More »

Write a program to add one to a given number. The use of operators like ‘+’, ‘-‘, ‘*’, ‘/’, ‘++’, ‘–‘ …etc are not allowed.… Read More »

Given a integer x, write a function that multiplies x with 3.5 and returns the integer result. You are not allowed to use %, /,… Read More »