python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to print all the permutations of two lists in a custom format?
P = [(2, 2, 3), (2, 3, 2), (3, 2, 2)]
X = [[(1, 2, 4), (1, 4, 2), (2, 1, 4), (2, 4, 1), (4, 1, 2), (4, 2, 1)], [(1, 2, 6), (1, 6, 2), (2, 1, 6), (2, 6, 1), (6, 1, 2), (6, 2, 1)], [(1, 3, 6), (1, 6, 3...
Umesh N
Votes: 0
Answers: 1
Algorithm operation permutation in python: test different order of function execution
I have an algorithm that works like this (in pseudocode) :
def func_1(x):
apply processing 1 to x
return x
def func_2(x):
apply processing 2 to x
return x
def func_3(x):
apply ...
Vincent Clerc
Votes: 0
Answers: 3
Algorithm to swap subsequences of 2 permutations
Given 2 permutations of n elements (1 to n) that are unordered, I need to check if it is possible to go from the first one to the second one using the following swapping method:
Choose a subsequence o...
S H
Votes: 0
Answers: 1
How can i find all possible English words from a scrambled word
Given an input of scrambled word, and I have a file of English words. I want to find all possible words that can be formed from the scrambled word.
from itertools import permutations
def unscramble(sc...
Taiwo Solomon
Votes: 0
Answers: 2