All Questions
3 questions
5
votes
2
answers
2k
views
Find non-overlapping pairs of elements in a list whose difference is less than some given threshold
I have the following task: Let us have a list (denoted by L, and for simplicity, the elements come from the interval [0,1]). We are given a parameter (denoted by C), and we want to find as many pairs ...
7
votes
2
answers
6k
views
Permutations with replacement in Python
Many a times, I've had the need to use a permutations with replacement function.
So, I've written a function to do just that:
...
3
votes
1
answer
228
views
Stable reversed Tartaglia's triangles
Inspired by Minimising the triangle
I am writing a fully tested program to solve the following problem:
A triangle needs a good foundation. Every row in the triangle is derived from the sum of the ...