## Efficient method for 2’s complement of a binary string

Given a Binary Number as string, print its 2’s complements. 2’s complement of a binary number is 1 added to the 1’s complement of the… Read More »

- Must do Math for Competitive Programming
- Array of Vectors in C++ STL
- Breadth First Search without using Queue
- Minimize the maximum difference between adjacent elements in an array
- Reverse a singly Linked List in groups of given size | Set 3
- How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?
- Shortest Path Faster Algorithm
- Maximum sum path in a Matrix
- Maximum number of unique values in the array after performing given operations
- Basic Algorithm Techniques Not Taught in Academics
- Count of subarrays having exactly K distinct elements
- Role of SemiColon in various Programming Languages
- Knapsack with large Weights
- Sum of GCD of all possible sequences
- Why Data Structures and Algorithms Are Important to Learn?
- Traveling Salesman Problem using Genetic Algorithm
- Minimum Cost Graph
- Maximum LCM among all pairs (i, j) from the given Array
- Minimum possible travel cost among N cities
- Longest subsequence having difference atmost K
- Count of subarrays which start and end with the same element
- Huffman Coding using Priority Queue
- Find lexicographically smallest string in at most one swaps
- Median of an unsorted array using Quick Select Algorithm
- Word Break Problem | DP-32 | Set - 2
- Operator Overloading '<<' and '>>' operator in a linked list class
- Longest Mountain Subarray
- Sort an Array which contain 1 to N values in O(N) using Cycle Sort
- Find last remaining element after reducing the Array
- Minimum increment or decrement required to sort the array | Top-down Approach

Given a Binary Number as string, print its 2’s complements. 2’s complement of a binary number is 1 added to the 1’s complement of the… Read More »

Given a positive integer n. Find the minimum number which divide n to make it a perfect square. Examples: Input : n = 50 Output… Read More »

Given two linked lists, the task is to check whether the first list is present in 2nd list or not. Examples: Input : list1 =… Read More »

We have a circle centered at origin (0, 0). As input we are given with starting angle of the circle sector and the size of… Read More »

Given an integer array of which both first half and second half are sorted. Task is to merge two sorted halves of array into single… Read More »

Given an array of n integers and a positive number k. We are allowed to take any k integers from the given array. The task… Read More »

Given a knapsack weight W and a set of n items with certain value vali and weight wti, we need to calculate minimum amount that… Read More »

For a given number n > 0, find the number of different ways in which n can be written as a sum of at two… Read More »

Given a integer K. Task is Print All binary string of size K (Given number). Examples: Input : K = 3 Output : 000 ,… Read More »

Given a positive integer n, the task is to find whether this number reaches to 1 after performing following two operations:- If n is even,… Read More »

Given three positive integer n, x, y. The task is to print Greatest Common Divisor of numbers formed by n repeating x times and number… Read More »

Given two integers A & B. Task is to check if A and B are same or not without using comparison operators. Examples: Input :… Read More »

Given two arrays of equal size n and an integer k. The task is to permute both arrays such that sum of their corresponding element… Read More »

Given two numbers x and y (x <= y), find out the total number of natural numbers, say i, for which i! is divisible by… Read More »

Given an array of n elements and an integer k. The task is to find the count of subarray which has maximum element greater than… Read More »