Solved

Word Counting and Indexing

You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

2 years ago

Solved

Given two arrays, find the maximum overlap

Given two (integer) arrays s1 and s2, create a new array s3 which is as short as possible and contains both arrays. #1 s1 = [...

2 years ago

Solved

It dseon't mettar waht oedrr the lrettes in a wrod are.

An internet meme from 2003 (read more here) asserted that readers are relatively insensitive to letter order in words, so long a...

2 years ago

Solved

Calculate the Levenshtein distance between two strings

This problem description is lifted from http://en.wikipedia.org/wiki/Levenshtein_distance. The Levenshtein distance between two...

2 years ago

Solved

Interpolator

You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end),...

2 years ago

Solved

Differential equations I

Given a function handle |f| an initial condition |y0| and a final time |tf|, solve numerically the differential equation dy...

2 years ago

Solved

Monte-Carlo integration

Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....

2 years ago

Solved

Fibonacci sequence

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

2 years ago

Solved

The Birthday Phenomenon

First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

2 years ago

Solved

Throwing Dice - Will You Be Eaten By The Dragon?

You and a dragon have agreed to let dice rolls determine whether it eats you or not. The dragon will roll a single die, of x ...

2 years ago

Solved

Chess probability

The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

2 years ago

Solved

Recurring Cycle Length (Inspired by Project Euler Problem 26)

Preface: This problem is inspired by <http://projecteuler.net/problem=26 Project Euler Problem 26> and uses text from that quest...

2 years 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...

2 years 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 ...

2 years 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...

2 years 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...

2 years 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 ...

2 years 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, ...

2 years 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_ gri...

2 years 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 ...

2 years 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...

2 years ago

Solved

Project Euler: Problem 10, Sum of Primes

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

2 years ago

Solved

Project Euler: Problem 9, Pythagorean numbers

A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 + 16 ...

2 years ago

Solved

Project Euler: Problem 8, Find largest product in a large string of numbers

Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

2 years ago

Solved

Project Euler: Problem 7, Nth prime

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

2 years ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

2 years ago

Solved

Project Euler: Problem 5, Smallest multiple

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

2 years ago

Solved

Project Euler: Problem 4, Palindromic numbers

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ...

2 years ago

Solved

Project Euler: Problem 3, Largest prime factor

The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

2 years ago