Solved


Can the knight take out the pawn?
* position of knight = k * position of pawns = p can the knight take out those pawns? * k='Nf4' * p={'g6','g7'} then...

2 months ago

Solved


Checkmate-02
This is an extension of the problem <https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate> If the king is in...

2 months ago

Solved


Checkmate
* The positions of different chess pieces are given in a cell *p* . * The position of the king is given as *x* Determine i...

2 months ago

Solved


Count the ways to draw non-intersecting chords between points on a circle
There are 9 ways to draw non-intersecting chords between four points on the perimeter of a circle (including no chords at all). ...

2 months ago

Solved


Fill a rectangle with 1x1 and 2x2 tiles
A 3x2 rectangle can be filled with 1x1 and 2x2 tiles in three ways: The colors merely distinguish the sizes of the tiles. A 3...

2 months ago

Solved


Easy Sequences 5: Project Euler Problem 1 - Again!
We are all familiar with Project Euler Problem 1. This time let's try it on bigger multiples and larger range. Find the sum of ...

2 months ago

Solved


Easy Sequences 6: Coefficient sums of derivatives
Consider the polynomial function and its first-order derivative . The sums of the coefficients of P and P', are and , respecti...

2 months ago

Solved


Easy Sequences 11: Factorial Digits without Trailing Zeros
Here is an easy one... It is not difficult to count the number of digits of the factorial of a given number. For example for 'n...

2 months ago

Solved


Easy Sequences 9: Faithful Pairs
A "faithful number" is a non-prime number that is one less or one more than some prime number but not both. For example, for num...

2 months ago

Solved


Easy Sequences 12: 50th Prime
Write a function that outputs the th prime after a given number . For example, the th prime after is . NOTE: If itself is pr...

2 months ago

Solved


Find all vampire fangs
A vampire number is a number v that is the product of two numbers x and y such that the following conditions are satisfied: at ...

2 months ago

Solved


Multivariate polynomials - sort monomials
In <https://www.mathworks.com/matlabcentral/cody/problems/44260-multidimensional-polynomials-convert-monomial-form-to-array Prob...

2 months ago

Solved


Multivariate polynomials - overload multiplication
Problems <https://www.mathworks.com/matlabcentral/cody/problems/44260-multivariate-polynomials-convert-monomial-form-to-array 44...

2 months ago

Solved


Multivariate polynomials - convert monomial form to array
In <https://www.mathworks.com/matlabcentral/cody/problems/44259-product-of-two-multidimensional-polynomials Problem 44259> I ask...

2 months ago

Solved


Product of two multivariate polynomials
MATLAB <https://www.mathworks.com/help/matlab/polynomials.html has a few functions> for creating and manipulating single-variabl...

2 months ago

Solved


Clockwise or Counterclockwise
Given a list of 2-d points defining the vertices of a polygon, determine whether these points are sorted clockwise. The input...

2 months ago

Solved


Spherical radius given four points
Determine the radius of a sphere provided four non-coplanar points on the surface of the sphere. pts = [x1 y1 z1; x...

2 months ago

Solved


Generate a Parasitic Number
This problem is the next step up from Problem 156. Rather than determining if an input is a parasitic number, you will be asked ...

2 months ago

Solved


Pandigital number n°3 (Inspired by Project Euler 32)
After Problem 2319 and 2320. An n-digit number is pandigital if it makes use of all the digits 1 to n exactly ONCE. For examp...

2 months ago

Solved


Apply Function to Each Field of a Structure Array: Part 2
The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

2 months ago

Solved


Apply Function to Each Field of a Structure Array: Part 1
The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

2 months ago

Solved


Function composition - harder
Write a function that accepts an arbitrary number of function handles f_1, f_2, ..., f_n and returns the composition h. That is,...

2 months ago

Solved


Flexible Anonymous Function
Given a function handle, return a handle to a function that would accept an arbitrary number of inputs, applies the function to ...

2 months ago

Solved


Handle to an array of functions
Given a cell array of functions that operate on scalars, it is required to return a function handle to process a vector of value...

2 months ago

Solved


Make an anonymous function that has variable output
Make a anonymous function that has variable output. f = @(x)... the following equation→equation(s) as followed has(ve) ...

2 months ago

Solved


Project Euler 249: Prime Subset Sums
Inspired by Problem 249 of Project Euler. <https://projecteuler.net/problem=249> Let S = {2, 3, 5, ...} be the set of prime ...

2 months ago

Solved


Bouncy numbers
Inspired by Project Euler n°112. Working from left-to-right if no digit is exceeded by the digit to its left it is called an ...

2 months ago

Solved


Count the even numbers in a multiplication table
A multiplication table that has products of numbers from 1 to 10 has 75 even numbers among the products. Write a function to c...

2 months ago

Solved


List lunar triangular numbers without duplication
Triangular numbers—which are the subject of Cody Problems 5, 291, 44289, 44732, 45833, 55680, 55695, and 55705—are the sums of c...

2 months ago

Solved


Spell musical triads
Chords form the basis of harmony in music. The most basic chords are triads, or groups of three notes. They are specified by thr...

2 months ago

Load more