Posts by Harsh Gupta

Author Biographical Info: Not available

Count set bits in an integer using Brian and Kerningham Algorithm in Python

By Harsh Gupta

In this article, we will learn Brian and Kerningham’s Algorithm to count the number of set bits of a number. Count set bits in an integer using Brian and Kerningham Algorithm.... Read More

Find elements which are present in first array and not in second in Python

By Harsh Gupta

You are given two arrays, your task is to find elements that are present in the first array and not in the second one. Input: arr1[]={1,6,88,5,9,13} arr2[]={1,6,78,9,3,2} Output: 8.... Read More

Negate a Boolean in Python

By Harsh Gupta

You are given a boolean in python and you have to negate it without writing tons of lines of code. Negation of a Boolean in Python Some of the methods to negate a boolean in python.... Read More

Left rotate an array by D places in Python

By Harsh Gupta

In this post, we will discuss some methods to left rotate an array by D places in Python. Left rotate an array by D places in Python You are given an array and value of D (number o.... Read More

Find Numbers with prime frequencies greater than or equal to k in C ++

By Harsh Gupta

We are given an array of positive integers and our task is to find the numbers which appear prime number of times and whose frequency is greater than or equal to a given number .... Read More

Check if a string is a number in Java

By Harsh Gupta

There are several ways to check whether the entered string is a number or not in Java program. Here I have mentioned three methods to do so. METHOD-1: We can parse String to Double.... Read More

const_cast in C++

By Harsh Gupta

In this tutorial, we will learn const_cast in C++ with examples. There are 4 types of casting operators as follows: 1. const_cast 2. static_cast 3. dynamic_cast 4. reinterpret_cast.... Read More

Check whether kth bit is set or not in Python

By Harsh Gupta

Bit plays a very important role while solving programming problems. In this article, we have discussed how to check whether the kth bit of a number is set or not in Python. We have.... Read More