Miscellaneous

## Check if a number is power of 8 or not

Given a number check whether it is power of 8 or not. Examples: Input : n = 64 Output : Yes Input : 75 Output… Read More »

## Check if a number has two adjacent set bits

Given a number you have to check whether there is pair of adjacent set bit or not. Examples : Input : N = 67 Output… Read More »

## Position of rightmost common bit in two numbers

Given two non-negative numbers m and n. Find the position of rightmost same bit in the binary representation of the numbers. Examples: Input : m… Read More »

## Check whether all the bits are set in the given range

Given a non-negative number n and two values l and r. The problem is to check whether all the bits are set or not in… Read More »

## Best meeting point in 2D binary array2

You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in a group. And the group… Read More »

## Output of C programs | Set 55

1. What will be the output of the following program? [sourcecode language=”C” highlight=””] #include <stdio.h> int main() { int a = 03489; printf("%d", a); return… Read More »

## _Noreturn function specifier in C

After the removal of “noreturn” keyword, C11 standard (known as final draft) of C programming language introduce a new “_Noreturn” function specifier that specify that… Read More »

## Snowflakes Fractal using Python

To create Snowflake fractals using Python programming What are fractals A fractal is a never-ending pattern. Fractals are infinitely complex patterns that are self-similar across… Read More »

## Image Splicing | Set 1 (Introduction)

Image Forgery can be largely divided into two sub categories: (1) Copy Move Forgery (2) Image Splicing Copy Move Forgery Copy Move forgery is a… Read More »

## 1 to n bit numbers with no consecutive 1s in binary representation

Given a number n, our task is to find all 1 to n bit numbers with no consecutive 1s in their binary representation. Examples :-… Read More »

## Goldman Sachs Interview Experience | Set 32 (On campus)

Goldman Sachs conducted on campus hiring for tech interns in our campus. CGPA cutoff: 7.0 Branches Eligible: All circuital branches Online Round: An online round… Read More »

## Find the n-th number whose binary representation is a palindrome

Find the nth number whose binary representation is a palindrome. Do not consider the leading zeros, while considering the binary representation. Consider the 1st number… Read More »

## Shuffle a pack of cards and answer the query

Given a pack of 2^N cards (0 … 2^N – 1), shuffle it in N steps. At step k (0 < k < N) we… Read More »

## std::set_symmetric_difference in C++

Symmetric difference of two sorted ranges The symmetric difference of two sets is formed by the elements that are present in one of the sets,… Read More »

## numpy.flipud() in Python

About : numpy.flipud(array) : Flip array(entries in each column) in up-down direction, shape preserved Parameters : array : [array_like]Input array, we want to flip Return… Read More »