Solved


Which permutation is it?
Let write some permutations of positive integers. 1: 1 2 3 4 5 6 ... 2: 2 1 3 4 ... 3: 1 3 2 4 ....

3 months ago

Solved


Scrabble Scores - 10
This problem is very similar to the previous problem. Here, you are provided a letter of an existing word on the board from whic...

3 months ago

Solved


A (wrong) place for everything, and everything in its (wrong) place
You have an equal number of cups and balls, each labelled from one to N. You randomly place one ball in each cup. Determine th...

3 months ago

Solved


Sum the unitary divisors of a number
Cody Problems 1933 and 46898 deal with , the sum of divisors function. This problem deals with , the sum of unitary divisors fun...

3 months ago

Solved


Numbered lottery balls into cells
You are running a lottery, and have a number of different balls numbered 1 to N. Your job is to figure out how many different w...

3 months ago

Solved


Count the unitary divisors of a number
Cody Problem 56738 asks for a list of the unitary divisors of a number. For this problem, write a function to count the unitary ...

3 months ago

Solved


Scrabble Scores - 8
This problem is part of a set of problems that successively develop a more sophisticated Scrabble scoring routine. The point dis...

3 months ago

Solved


Count estrangements
Recently I made a puzzle for my wife that included a cryptogram, which involves an arrangement of the letters A through Z. I use...

3 months ago

Solved


Get ranking of a combination
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to ...

3 months ago

Solved


Scrabble Scores - 4
This problem is part of a set of problems that successively develop a more sophisticated Scrabble scoring routine. The point dis...

3 months ago

Solved


Usage of java.math : N Choose K with unlimited precision
Calculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allo...

3 months ago

Solved


NCHOOSEK - Time Optimization
Input V —— Set of all choices, a vector of N, 1 < N < 100 K —— Number of selected choices, a scalar, 0 <= K <= N Output C ——...

3 months ago

Solved


Determine whether a number is practical
A number is practical if all smaller numbers can be written as a sum of the proper divisors of . The number 24 is practical bec...

3 months ago

Solved


Create Combination
Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...

3 months ago

Solved


Code breaker, Part II: Operation Orthos
You have been tasked with decoding several batches of coded messages that have been intercepted. Based on previous intellig...

3 months ago

Solved


Next lexicographic - permutation
Find next lexicographic - permutation (permutations as it would occur in a dictionary order). E.g: nextP('ABCD') = ABDC If you...

3 months ago

Solved


PACMAT 05 - Optimized Ghosts, PACMAT increasing speed, 12 Lives
The Classic PACMAN game brought to Cody. PACMAT requires clearing the Yellow Dots while avoiding the wandering ghosts in 12 l...

3 months ago

Solved


Compute a determinant
Write a function to compute the determinant of an x matrix with diagonal entries equal to an integer and other entries equal ...

3 months ago

Solved


PACMAT 04 - Optimized Ghosts, Equal Speed, 10 Lives
The Classic PACMAN game brought to Cody. PACMAT requires clearing at least 130 Yellow Dots while avoiding the wandering ghost...

3 months ago

Solved


PACMAT - G03 Ghosts use minimum path to PACMAT; 3 Lives
The Classic PACMAN game brought to Cody. PACMAT requires clearing the board of Yellow Dots while not bumping into the wanderi...

3 months ago

Solved


Dickson Polynomials
Return the coefficients of nth (n>=0) Dickson polynomial of the 1st kind as follows - 1st row of the output will be the coeffi...

3 months ago

Solved


Find the longest runs of primes generated by polynomials
Cody Problems 60942, 60943, and 60944 involve polynomials that generate primes. No polynomial can generate only prime numbers, b...

3 months ago

Solved


Code breaker, Part I: Operation Phoenix
You have been tasked with decoding a set of coded messages that have been intercepted. Based on previous intelligence that ...

3 months ago

Solved


Pseudo-Zernike Polynomials
Problem #1476 deals with Radial Zernike Polynomials. Here, generate the Pseudo-Zernike Polynomials for a given order n and degr...

3 months ago

Solved


Shapiro Polynomials
Given an order n, return the coefficients of 1st Shapiro polynomials Pn(x) - %Example P1(x) = x + 1 => Output = [1 1]; P...

3 months ago

Solved


Rooky Towers
You are wandering and as you realise something's off, you find yourself lost in a peculiar place - Over a giant field which is ...

3 months ago

Solved


Padovan Polynomials
Hello there. I'm afraid I bear bad news - Anakin Skywalker is no longer a Jedi. But fear not young Padawan, we shall not falter...

3 months ago

Solved


Stirling Numbers - I
Problems #1388 & #45187 deal with Stirling numbers of the 2nd Kind. Here, generate the Stirling numbers S(n,k) of the 1st kind ...

3 months ago

Solved


Touchard Polynomial
Return the coefficients of nth (n>=0) Touchard polynomials - T1(x) = x; output = [1 0]; T2(x) = x^2 + x; output = [1 1 0]...

3 months ago

Solved


Bernstein Basis Polynomials
Return the coefficients of a Bernstein Basis Polynomial B(v,n) for degree n and order v - %Examples B(2, 5) = 10*x^2*(1-x)...

3 months ago

Load more