## Given an array, find the number of all pairs with odd sum.

Objective: Given an array of integers, write a program to find the number of pairs with even odd. Example: Given Input: [1, 2, 3, 4] Number of odd pairs: 4 Note: (1, 2), (1,...

Skip to content# Author: SJ

## Given an array, find the number of all pairs with odd sum.

## Given an array, find all unique subsets with a given sum with allowed repeated digits.

## Print all steps to convert one string to another string

## Lexicographically next permutation With One swap

## Find all subsets of size K from a given number N (1 to N)

## Sum of distinct elements among two given sets

## Find all possible combinations with sum K from a given number N(1 to N) with the repetition of numbers is allowed

## Stable Marriage Problem – Gale–Shapley Algorithm – Java

## Insert a node in the given sorted linked list.

## Construct the largest number from the given array.

## Given an array, find three-element sum closest to Zero

## Print sorted unique elements of a given array

## Given an array, print all unique subsets with a given sum.

## Sum of length of subsets which contains given value K and all elements in subsets are less than equal to K.

## Replace array elements with maximum element on the right.

@tutorialhorizon

Objective: Given an array of integers, write a program to find the number of pairs with even odd. Example: Given Input: [1, 2, 3, 4] Number of odd pairs: 4 Note: (1, 2), (1,...

Objective: Given an array of integers and number N, Write an algorithm to find and print all the unique subsets of array for which sum is equal to N where array elements can be...

Objective: Given two strings, source string and target string, which are permutation or anagram of each other. You are allowed two swap only consecutive characters. Write an algorithm to print all the steps (...

Objective: Given an array of integers (in particular order or permutation of a set of numbers), write an algorithm to find the lexicographically next permutation of the given permutation with only one swap. This...

Objective: Given two integers N and K, Write an algorithm to find subsets of size K from the numbers 1 to N. Example: N = 5 K = 3 Output: [1, 2, 3] [1,...

Objective: Given two sets of elements, find the sum of all distinct elements from the set. In other words, find the sum of all elements which are present in either of the given set. ...

Objective: Given two integers N and K, Write an algorithm to find possible combinations that add to K, from the numbers 1 to N. Condition: An integer from 1 to N can be repeated...

Stable Marriage Given N men and N women and the marriage preference order for each man and woman. Their marriage will be stable when these men and women marry in such a manner so...

Objective: Given a linked list in which nodes are sorted in ascending order. Write an algorithm to insert a given node into the linked list so that all the nodes in the list will...

Objective: Given an array of integers, write an algorithm to construct the largest number possible by appending the array elements. Example: Given Input: [7, 78] Largest Number Possible: 787 Explanation: two possibilities are 778...

Objective: Given an array of integers, find the sum of any three elements which is closest to zero. The array may contain positive and negative elements. Example: Given Input: [-1, 4, -2, 5, 10,...

Objective: Given an array of integers with duplicates, write a program to print unique elements in the array in sorted order. Example: Given Input: [6, 1, 8, 5, 2, 10, 17, 25, 6, 5,...

Objective: Given an array of integers and number N, Write an algorithm to find and print all the subsets of the array for which sum is equal to N. Example: input [] = {6,2,7,8,2,4,1,3,7,5}...

Objective: Given an array of numbers and integer K. Your task is to find lengths of all the subsets which contain value K and all elements in the subset are less than equal to...

Objective: Given an array of integers, write a program to replace its elements with the maximum element on the right side from their respective positions. Note: If the element is equal to the maximum...

%d bloggers like this: