Solved


Calculate a modified Levenshtein distance between two strings
Inspired by the Cody problem found here. The Levenshtein distance is a charater-based string metric used to measure the differe...

1 month ago

Solved


QWERTY Shift Encoder
Encode a string using the QWERTY shift code. This code is where you touch type but are offset by one character to the right. O...

1 month ago

Solved


Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifm...

1 month ago

Solved


Project Euler: Problem 18, Maximum path sum I
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bott...

1 month ago

Solved


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

1 month ago

Solved


Longest Collatz Sequence
Inspired by Projet Euler n°14. The Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of po...

1 month ago

Solved


Large Sum (inspired by Project Euler 13)
Your function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will b...

1 month ago

Solved


Divisors for big integer
Inspired by Problem 1025 and Project Euler 12. Given n, return the number y of integers that divide N. For example, with ...

1 month ago

Solved


Highly divisible triangular number (inspired by Project Euler 12)
Triangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are: 1, 3, 6, 10, ...

1 month ago

Solved


Project Euler: Problem 11, Largest product in a grid
What is the greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in a n×n grid ? ...

1 month ago

Solved


Sum of big primes without primes
Inspired by Project Euler n°10 (I am quite obviously a fan). With problem n°250 by Doug, you can find some global methods to co...

1 month ago

Solved


Sums of cubes and squares of sums
Given the positive integers 1:n, can you: 1. Compute twice the sum of the cubes of those numbers. 2. Subtract the square...

1 month 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...

1 month 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 ...

1 month ago

Solved


Easy Sequences 4: Eliminate the Days of Confusion
If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, "...

1 month ago

Solved


Easy Sequences 3: Prime 44-number Squares
The positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd ...

1 month ago

Solved


Easy Sequences 2: Trigonometric function with integral input and output
The function 'F', defined as: , will always return an integer if the input is a natural number (in radian...

1 month ago

Solved


Easy Sequences 1: Find the index of an element
The nth element of a series is defined by: . Obviously, the first element . Given the nth element , find the value of the corre...

1 month ago

Solved


Create a block diagonal matrix
A block diagonal matrix is a square matrix that can be written as A = [a 0 0 0 0 b 0 0 0 0 c 0 ...

1 month ago

Solved


The Matrix Construction
Given two input ,first one is CN (Column Number), Second one is Dim Can you produce such a matrix for example CN=6; Dim=2 ...

1 month ago

Solved


Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...

1 month ago

Solved


Generate this matrix
For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...

1 month ago

Solved


Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

1 month ago

Solved


Rainbow matrix
Create a "rainbow matrix" as described in the following examples Input = 3 Output = [ 1 2 3 2 3 2 ...

1 month ago

Solved


Pascal's pyramid
In Pascal's triangle each number is the sum of the two nearest numbers in the line above: 1 1 1 ...

1 month ago

Solved


Triangular matrices in 3D array
Given a 3D numeric array _x_, return an array _y_ of the same size in which all entries to the right of the main diagonal are ze...

1 month ago

Solved


BULLSEYE Part 2: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

1 month ago

Solved


Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

1 month ago

Solved


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

1 month ago

Solved


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

1 month ago

Load more