Community Profile

# Ben Jackson

53 total contributions since 2017

#### Ben Jackson's Badges

View details...

Contributions in
View by

Solved

It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

ongeveer 2 jaar ago

Solved

Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

ongeveer 2 jaar ago

Solved

Scrabble Scores
Given a word, determine its score in <http://en.wikipedia.org/wiki/Scrabble Scrabble>. The input string will always be provi...

ongeveer 2 jaar ago

Solved

Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

ongeveer 2 jaar ago

Solved

Extract leading non-zero digit
<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

ongeveer 2 jaar ago

Solved

Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

ongeveer 2 jaar ago

Solved

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

ongeveer 2 jaar ago

Solved

De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

ongeveer 2 jaar ago

Solved

Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: \$99,999.99. E...

ongeveer 2 jaar ago

Solved

Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

ongeveer 2 jaar ago

Solved

radius of a spherical planet
You just measured its surface area, that is the input.

ongeveer 2 jaar ago

Solved

Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

ongeveer 2 jaar ago

Solved

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

ongeveer 2 jaar ago

Solved

Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

ongeveer 2 jaar ago

Solved

Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

ongeveer 2 jaar ago

Solved

Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

ongeveer 2 jaar ago

Solved

The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

ongeveer 2 jaar ago

Solved

Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

ongeveer 2 jaar ago

Solved

Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

ongeveer 2 jaar ago

Solved

Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

ongeveer 2 jaar ago

Solved

Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

ongeveer 2 jaar ago

Solved

Min of a Matrix
Return the minimum value in the given matrix.

ongeveer 2 jaar ago

Solved

The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

ongeveer 2 jaar ago

Solved

Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

ongeveer 2 jaar ago

Solved

Matrix element wise multiplication
Take two incoming vectors, and multiply them element wise

ongeveer 2 jaar ago

Solved

Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

ongeveer 2 jaar ago

Solved

Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

ongeveer 2 jaar ago

Solved

Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

ongeveer 2 jaar ago

Solved

Is my wife right?
Regardless of input, output the string 'yes'.

ongeveer 2 jaar ago

Solved

Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

ongeveer 2 jaar ago