Problem


Compute the number of squares a knight can reach after n moves
Several Cody problems involve knights from chess. They have asked players to find a knight’s tour in a matrix (CP 96), determine...

2 years ago | 0 | 8 solvers

Solved


Write a MATLAB function that takes a positive integer ( n ) as input and returns the sum of all the even numbers from 1 to ( n ).
Write a MATLAB function that takes a positive integer ( n ) as input and returns the sum of all the even numbers from 1 to ( n )...

2 years ago

Solved


Implement the signum function
The signum function is a common mathematical function, which has the following definition : If x => 0, its value is 1, if x < 0...

2 years ago

Solved


Generate a point cloud on an equilateral triangle 1
The input is the iteration parameter H. The output is a point cloud W involving N points. W is N uniformly distributed points ...

2 years ago

Problem


Compute the totient summatory function
Cody Problem 656 deals with the totient function, denoted by which counts the numbers less than that are relatively prime to ....

2 years ago | 0 | 7 solvers

Solved


ICFP 2024 Programming Contest June 28 thru July 1
This is to announce the annual ICFP programming contest for 2024. The ICFP 2024 homepage link is ICFP 2024 . Registration will...

2 years ago

Solved


Pronounce digits
Given a number num, select the first d decimal places and pronounce the digits (in English). The function returns the pronunciat...

2 years ago

Problem


Compute Farey sequences
Problem statement The Farey sequence of order consists of fractions between 0 and 1 expressed in reduced form in increasing or...

2 years ago | 1 | 11 solvers

Solved


Remove Adjacent Pairs
Given an array of integers where adjacent elements may be identical, your task is to remove these adjacent pairs. If removing on...

2 years ago

Problem


Compute a sum
Write a function to compute the following sum Although a solution is available for general values of the coefficients, the co...

2 years ago | 1 | 13 solvers

Solved


Fast Fourier transform algorithm
Your task is to implement the Fast Fourier transform algorithm, without using builtin MATLAB fft commands e.g. fft, fft2, or har...

2 years ago

Solved


Optimally fill a container with elements of different sizes
Given a row vector V of different numerical values and a size limit L, return a 1x2 vector A, containing (a) the largest sum of ...

2 years ago

Solved


Find the largest sum of any contiguous subarray
Given an array of N integers, find the contiguous subarray (which must contain at least one number) with the maximum sum and ret...

2 years ago

Solved


Largest Rectangle Area in a Histogram
Given a histogram represented by an array of integers, e.g., [2, 1, 4, 5, 1, 3, 3] : find the maximum area of a rectangle tha...

2 years ago

Solved


Calculating the Union Area of Overlapping Rectangles
Calculate the area covered by a union of multiple rectangles. Each rectangle is represented by 4 integers: the first two integer...

2 years ago

Solved


Reversing Maximal Ascending Subsequences
Create and return a new array that contains the same elements as the input array, but with the elements within each strictly inc...

2 years ago

Solved


Secret Message and Acrostic
One of the simplest ways to hide a message involves utilizing uppercase letters. Given a text, collect all uppercase letters in...

2 years ago

Solved


String Find with Wildcards of a Cell array
Given a cell array of strings and a search string with single character (?) or multiple character (*) wildness return the indice...

2 years ago

Solved


Find the quantization index of an analog value using a 6-bit quantizer.
Given a sinusoidal waveform x(t)=4.5*sin(2*pi*100*t) is sampled at 8000 sample per second. Assume that signal range is between -...

2 years ago

Solved


Find two numbers that add up to the target value
Given a vector A and target n, return the indices of two numbers that add up to n. If there are multiple solutions, return the f...

2 years ago

Solved


Minimum Distance Point to Segment
This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point. The point is (p...

2 years ago

Solved


Speed of light:Experiment
in 1849, Fizeau set up an experiment to measure the speed of light. The discription of this experiment can be found on wikipedi...

2 years ago

Solved


Find the Peak Particle Velocity on a ETL structure
PPV is a vibration parameter that can connect stress to a structure, it is measured in mm/s or mm/s-1. The higher the PPV the mo...

2 years ago

Solved


Logic 7

2 years ago

Solved


Can you Jump?
You have been provided with input array of integers. You start with initial position at the first index of this input array, and...

2 years ago

Problem


Compute a sequence with the whyphi sieve
A few problems on Cody involve sieving. For example, Cody Problem 45367 involves the famous Sieve of Eratosthenes. CP 50811uses ...

2 years ago | 0 | 6 solvers

Solved


USC Fall 2012 ACM : Code Word Minimum Flipped Bits
This Challenge is to solve Question A of the <http://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012 Contest>. Given ...

2 years ago

Solved


Easy Sequences 40: Quadratic Congruence
Quadratic Congruence is a modular equation of the form: . In this exercise you will be given a vector containing the coefficie...

2 years ago

Solved


Alternate Arrangement
Determine the ways of arranging 'm' men and 'w' women alternatively in a row of 's' seats. Assumptions : s<m and s<w

2 years ago

Solved


Draw the Greek letter 'α'
Given the dimensions of a matrix nRow and nCol where nCol > nRow, draw the Greek letter 'α' with 1's and 0's. You can consider t...

2 years ago

Load more