Find all distinct combinations of a given length – II
Given an integer array, find all distinct combinations of a given length k. The program should print only distinct combinations.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven an integer array, find all distinct combinations of a given length k. The program should print only distinct combinations.
Given an integer array, find a subset in it having the maximum product of its elements.
Given a string and a pattern, determine if the pattern matches with the string or not. The solution should not use any regex.
Given a positive integer, find the minimum number possible by doing at-most k swap operations upon its digits.
Given an M × N boggle board, find a list of all possible words that can be formed by a sequence of adjacent characters on the board.
Given a positive number n, find all combinations of 2×n elements such that every element from 1 to n appears exactly twice and the distance between its two appearances is exactly equal to the value of the element.
Generate all permutations of a string in Java.
Given an integer array, find all distinct combinations of a given length k, where the repetition of elements is allowed.
Given an integer array, find all distinct combinations of a given length k. The program should print only distinct combinations.
Given a binary tree, write an efficient algorithm to print all paths from the root node to every leaf node in it.
Given a string, find all combinations of non-overlapping substrings of it. The solution should use parenthesis to split the string into non-overlapping substrings.
This post will find all permutations of a string containing all distinct characters in C++. For example, the string ABC has 6 permutations, i.e., ABC, ACB, BAC, BCA, CBA, CAB.