Output of Python Program | Set 4

Difficulty level : Intermediate Predict the output of following Python Programs. Program 1: filter_none edit close play_arrow link brightness_4 code nameList = [‘Harsh’, ‘Pratik’, ‘Bob’,… Read More »

Counts of distinct consecutive sub-string of length two using C++ STL

Given a string the task is to print all distinct sub-strings of length two in the given string. All substrings should be printed in lexicographical… Read More »

Python Program for n\’th multiple of a number in Fibonacci Series

Given two integers n and k. Find position the n\’th multiple of K in the Fibonacci series. Examples: Input : k = 2, n =… Read More »

Java Program for nth multiple of a number in Fibonacci Series

Given two integers n and k. Find position the n’th multiple of K in the Fibonacci series. Examples: Input : k = 2, n =… Read More »

C/C++ Program for nth multiple of a number in Fibonacci Series

Given two integers n and k. Find position the n’th multiple of K in the Fibonacci series. Examples: Input : k = 2, n =… Read More »

n’th multiple of a number in Fibonacci Series

Given two integers n and k. Find position the n’th multiple of K in the Fibonacci series. Examples : Input : k = 2, n… Read More »

Java.util.BitSet class in Java with Examples | Set 1

BitSet is a class defined in the java.util package. It creates an array of bits represented by boolean values. Constructors: BitSet class Constructors / \… Read More »

Recursively break a number in 3 parts to get maximum sum

Given a number n, we can divide it in only three parts n/2, n/3 and n/4 (we will consider only integer part). The task is… Read More »

LCM of First n Natural Numbers

Given a Number n such that 1 <= N <= 10^6, the Task is to Find the LCM of First n Natural Numbers. Examples: Input… Read More »

Smallest subarray whose sum is multiple of array size

Given an array of size N, we need to find smallest sized subarray whose sum is divisible by array size N. Examples : Input :… Read More »

auto_ptr, unique_ptr, shared_ptr and weak_ptr

Prerequisite – Smart Pointers C++ libraries provide implementations of smart pointers in following types: auto_ptr unique_ptr shared_ptr weak_ptr They all are declared in a memory… Read More »

Count All Palindromic Subsequence in a given String

Find how many palindromic subsequence (need not necessarily be distinct) can be formed in a given string. Note that the empty string is not considered… Read More »

Bitwise and (or &) of a range

Given two non-negative long integers, x and y given x <= y, the task is to find bit-wise and of all integers from x and… Read More »

Calculate XOR from 1 to n.

Given a number n, the task is to find the XOR from 1 to n. Examples : Input : n = 6 Output : 7… Read More »

Maximum mirrors which can transfer light from bottom to right

A square matrix is given in which each cell represents either a blank or an obstacle. We can place mirrors at blank positionl. All mirrors… Read More »