Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
3 votes
2 answers
454 views

Pascal's triangle solution in Python code

I have solved the pascal's triangle problem. I am not good at writing efficient programs, hence any suggestions/ comments shall be welcomed. ...
Zainab Saad's user avatar
5 votes
4 answers
470 views

Check whether a permutation with one fixed point can be rotated into one with two fixed points

A friend gave me the following riddle: Given n people with n distinct names, you place n names tags on a round table with n seats. If the n people now sit at those seats randomly such that exactly ...
ViktorStein's user avatar
3 votes
2 answers
291 views

Fixed Content Necklace Generator

I wrote a class that generates combinatorial necklaces with fixed content as per Sawada: A fast algorithm to generate necklaces with fixed content. The class is instantiated with an input list that ...
Rek's user avatar
  • 33
2 votes
2 answers
987 views

Project Euler # 24 Lexicographic permutations in Python

A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we ...
user avatar
4 votes
2 answers
2k views

Steinhaus-Johnson-Trotter Algorithm

I began to program a little while ago and tried to implement my first algorithm: the Steinhaus-Johnson-Trotter algorithm. This algorithm generates a sequence of permutations of \$n\$ elements such ...
Onur C.Y.'s user avatar
  • 141
6 votes
1 answer
818 views

Computation of product of permutations

Given a graph \$G = (V,E)\$ with a unique labeling of each vertex, let the transposition \$(i,j)\$ (where \$i,j\$ are the labels on adjacent vertices) represent selecting an edge and swapping the ...
Santana Afton's user avatar
8 votes
1 answer
983 views

Recursive search for combinations of words that have a specified MD5 hash

This code solves a challenge problem that a local company is hosting to attract/screen applicants. The link to the challenge is here. In brief, we are given a wordlist containing approximately 100,...
Charles Harris's user avatar
6 votes
2 answers
599 views

Solver for Jumble puzzle

Here is my first attempt to solve Jumble puzzle: ...
inyoot's user avatar
  • 347