A résolu


Pumpkin Pie!
It's time for desert at Thanksgiving. You've all gathered at grandma's house, and she's about to start cutting the pumpkin pie. ...

plus de 7 ans il y a

A résolu


Muphry's Law of MATLAB
You're running some simple multiplication problems through MATLAB for error checking purposes, but nothing seems to come up with...

plus de 7 ans il y a

A résolu


Solve The Equation
The coefficients of a system of equations are given in two vectors, x1 and x2. Write a function to solve the equation and return...

plus de 7 ans il y a

A résolu


How many days?!?
Christmas is coming earlier and earlier each year. Thanks to rampant commercialism and Christmas Creep, "The Twelve Days of Chr...

plus de 7 ans il y a

A résolu


Amicable numbers
Test whether two numbers are <https://en.wikipedia.org/wiki/Amicable_numbers amicable>, meaning that the sum of the proper divis...

plus de 7 ans il y a

A résolu


Aztec Diamond Domino Tilings
Consider a Cartesian grid, with verteces at integer x and y values, where every four vertices around a vacant space define a uni...

plus de 7 ans il y a

A résolu


Expand 10^n to Powers of 4
Given an integer n, return the coefficients c = [c_n,c_n-1,...,c_0] Such that 10^n = c_n*4^(n) + c_n-1*4^(n-1...

presque 8 ans il y a

A résolu


The Deadly Sin
Melvyn and Banner are fighting over chocolates. Melvyn has X chocolates, while Banner has Y. Whoever has a lesser number of choc...

presque 8 ans il y a

A résolu


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

presque 8 ans il y a

A résolu


Matrix to 3-Column Matrix
Consider a matrix *A* such as A = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8]; Can you convert this matrix to a three-column ...

presque 8 ans il y a

A résolu


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

presque 8 ans il y a

A résolu


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

presque 8 ans il y a

A résolu


Substring Extraction
In a given string, find the substring between Start_string and End_string. You will have to include or exclude the Start_str...

presque 8 ans il y a

A résolu


Moving Product (Easy)
Given an input array A, write a function *movprod(A,k,dim)* to calculate the moving product over a sliding window of length *k* ...

presque 8 ans il y a

A résolu


Find the Pattern
Find the pattern between input and output. Write a function that gives the correct output for any input. *Hint: magic*

presque 8 ans il y a

A résolu


Minimum of each diagonal
The well-known <http://www.mathworks.com/help/matlab/ref/min.html min> function can operate along either the rows or the columns...

presque 8 ans il y a

A résolu


Pass the Threshold!!
Write a Matlab function that will take as input a matrix of arbitrary dimensions and a scalar threshold value, and return a vec...

presque 8 ans il y a

A résolu


Cumulative minimum of an array
Find the cumulative minimum of an array without using the built-in function <http://www.mathworks.com/help/matlab/ref/cummin.htm...

presque 8 ans il y a

A résolu


Fill the Matrix - 2
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the me...

presque 8 ans il y a

A résolu


Find argmax of a function
You are given vectors x and y (=f(x)). Return the element of x for which f(x) is maximized.

presque 8 ans il y a

A résolu


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

presque 8 ans il y a

A résolu


Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

presque 8 ans il y a

A résolu


Sort Reversal
There are n index cards in a row, with n distinct integers written on them (one number per card) so that the numbers are sorted ...

presque 8 ans il y a

A résolu


007: Chinese Barrack Invasion
*MISSION:* Successfully invade a military barrack located in China. *WARNING:* There is a row of _n_ security switches protec...

presque 8 ans il y a

A résolu


Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

presque 8 ans il y a

A résolu


Seperate array to small section according to its index position
Given a integer n, we can generate a sequence [0,1,2,3,4,..., 2^n-1], then we separate it to two sequence according to their ind...

presque 8 ans il y a

A résolu


The Google Interview: Two Eggs Problem
Consider the following problem, a popular Google interview question: A firm has invented a super-strong egg. For publicity pu...

presque 8 ans il y a

A résolu


God of War: The Chains Of Olympus
The Spartan warrior, Kratos, is held by a chain of _n > 1_ links in the underworld. His only chance of survival is to break the ...

presque 8 ans il y a

A résolu


Counting Squares
An algorithm starts with a single square and on each of its next iterations adds new squares all around the outside as shown bel...

presque 8 ans il y a

A résolu


Penny Distribution Machine
A machine consists of a row of boxes. To start, one places N pennies in the leftmost box. The machine then redistributes the pen...

presque 8 ans il y a

Charger plus