Given a set represented as string, write a recursive code to print all subsets of it. The subsets can be printed in any order. Examples:… Read More »

Given a positive integer n, check whether only the first and last bits are set in the binary representation of n. Print ‘Yes’ or ‘No’.… Read More »

Finding LCM using GCD is explained here but here the task is to find LCM without first calculating GCD. Examples: Input: 7, 5 Output: 35… Read More »

Given an array of N positive integers. The task is to find the sum of maximum sum decreasing subsequence(MSDS) of the given array such that… Read More »

Given a Binary tree and a number N, write a program to find the N-th node in the Preorder traversal of the given Binary tree.… Read More »

Given two positive and distinct numbers, the task is to find the greatest of two given numbers without using any conditional statements(if…) and operators(?: in… Read More »

Given a matrix of size N X N of integers. The task is to find the number of decreasing path in the matrix. You are… Read More »

Given an array A of N integers and a positive integer K. Only three operations can be performed on this array: 1) Replace an integer… Read More »

Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater… Read More »

Given two positive integers m and n, the task is to write a program that checks whether m^n is greater than, less than or equal… Read More »

Given a BST, the task is to find the sum of all elements greater than and equal to kth largest element. Examples: Input : K… Read More »

Given a set of strings, find the longest common prefix. Examples: Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : “gee” Input : {“apple”, “ape”, “april”}… Read More »

Given a linked list with n nodes, reverse it in the following way : If n is even, reverse it in group of n/2 nodes.… Read More »

Consider two cars A and B, running infinitely (either clockwise or anti-clockwise) on a circular road. Given the speed of both the cars a and… Read More »

Round 1: The first round was a coding round with 2 questions on mettl: 1. Write a program to find sum of first largest k… Read More »

In this post, we will discuss what are different sources of data that are used in data mining process. The data from multiple sources are… Read More »

Round 1: The first round was a coding round with 2 questions on mettl: Write a program to find sum of first largest k elements from… Read More »

A Hilbert Matrix is a square matrix whose each element is a unit fraction. Properties: It is a symmetric matrix. Its determinant value is always… Read More »

Given an array of N integers, write a program that prints the length of the longest subarray such that adjacent elements of the subarray have… Read More »

Given an array of N integers. The bitwise OR of all the elements of the array has to be maximized by performing one task. The… Read More »