Risolto


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

circa 2 anni fa

Risolto


Find the palindrome
Given the string a, find the longest palindromic sub-string b. So when a = 'xkayakyy'; you should return b = 'kayak';

circa 2 anni fa

Risolto


Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

circa 2 anni fa

Risolto


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

circa 2 anni fa

Risolto


Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

circa 2 anni fa

Risolto


Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

circa 2 anni fa

Risolto


Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

circa 2 anni fa

Risolto


Find the stride of the longest skip sequence
We define a _skip sequence_ as a regularly-spaced list of integers such as might be generated by MATLAB's <http://www.mathworks....

circa 2 anni fa

Risolto


arithmetic progression
I've written a program to generate the first few terms of <https://en.wikipedia.org/wiki/Arithmetic_progression arithmetic progr...

circa 2 anni fa

Risolto


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

circa 2 anni fa

Risolto


Pair Primes
Let's define pair primes as follow; For 2 digits numbers: 11 and 17 are pair primes because both of them are 2 digits prime num...

circa 2 anni fa

Risolto


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

circa 2 anni fa

Risolto


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

circa 2 anni fa

Risolto


Scoring for oriented dominoes
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

circa 2 anni fa

Risolto


Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

circa 2 anni fa

Risolto


2048 Next Move
Given a board in the game 2048 (see the game here: <http://gabrielecirulli.github.io/2048/ 2048>) and a direction ('up','down','...

circa 2 anni fa

Risolto


Count consecutive 0's in between values of 1
So you have some vector that contains 1's and 0's, and the goal is to return a vector that gives the number of 0's between each ...

circa 2 anni fa

Risolto


Find vampire numbers
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such th...

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

circa 2 anni fa

Risolto


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

circa 2 anni fa

Risolto


Encode Roman Numerals
Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

circa 2 anni fa

Risolto


Counting in Finnish
Sort a vector of single digit whole numbers alphabetically by their name, in Finnish. See the Wikipedia page for <http://en.wik...

circa 2 anni fa

Risolto


Oh Zero Zero Zero!!!
Hello all, So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...

circa 2 anni fa

Risolto


Summing Digits within Text
Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

circa 2 anni fa

Risolto


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

circa 2 anni fa

Risolto


(Linear) Recurrence Equations - Generalised Fibonacci-like sequences
This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

circa 2 anni fa

Carica altro