Solved


Collect a set of candy wrappers
This past Halloween, the siblings Matilda and Labrun amused (and sometimes confused) their many neighbors with their costumes in...

4 days ago

Solved


Poly2mask, drawpolygon or patch
Recently, I tried to plot a polygon in matlab, and I found there is a lot of embedded function that can be used. However, some f...

4 days ago

Solved


Undocumented MATLAB tricks No. 2 - Tell the parfor index
Your function is called in multiple for-loops, and the loop indices are given to your function. One of these indices are from a ...

4 days ago

Solved


Multiply binary numbers
Write a function to multiply two binary numbers input as strings. For example, input values of ‘1011’ and ‘101’ should give ’110...

4 days ago

Solved


Circular Segment Area
Let us consider a circle with radius . If we draw an angle (in radians) from the center of the circle, the two radii forming th...

4 days ago

Solved


Undocumented MATLAB tricks No. 1 - Save a function-returned struct
Often we face the case when we want to save a function-returned struct to a mat file with each of its field as individual variab...

4 days ago

Solved


Vector to Decimal
Given an integer vector , return its decimal representation as a character array. % Examples v = 7 x = '7' % v = [4 2] x...

4 days ago

Solved


Draw a x-by-x matrix British flag (Euro 2020)
Draw a x-by-x matrix 'British flag' using '0' and '1'.(x is odd and bigger than 4) x = 5 answer = [0 0 1 0 0 ...

4 days ago

Solved


Draw matrix 'Swiss flag'( Euro 2020)
Draw a x-by-x matrix 'Swiss flag' using '0' and '1'.(x is odd and bigger than 4) Example x=5 ...

4 days ago

Solved


tetration
About tetration.

4 days ago

Solved


ICFP2021 Hole-In-Wall: Solve Problem 4, Score=0, Bonus GLOBALIST assumed
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

4 days ago

Solved


3n + 1 Problem (a.k.a The Collatz Conjecture)
The 3n + 1 problem (a.k.a The Collatz Conjecture) Consider the following algorithm to generate a sequence of numbers. Start wit...

5 days ago

Solved


Get to a number faster.
If you start with $1 and, with each move, you can either double your money or add another $1, what is the smallest number of mov...

5 days ago

Solved


Double Fibonacci
double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

5 days ago

Solved


Cancel Middle
Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

5 days ago

Solved


Draw 'S'
draw S using nxn matrix, where n is odd and greater than 4 S = [1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 ...

5 days ago

Solved


ICFP2021 Hole-In-Wall: Solve Problem 47, Score=0, Figure Vertices 11, Hole Vertices 10
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

5 days ago

Solved


ICFP2021 Hole-In-Wall: Solve Score=0, where number of Figure Vertices = Hole Vertices + 1
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

5 days ago

Solved


ICFP2021 Hole-In-Wall: Solve Score=0, where number Hole Vertices = Figure Vertices
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

5 days ago

Solved


ICFP2021 Hole-In-Wall: Figure Validation with Segment Crossing and Segment on Wall Checks
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

5 days ago

Solved


ICFP2021 Hole-In-Wall: Figure Validation with Segment Crossing Check
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

5 days ago

Solved


Guess the number I'm thinking of (Part 2)
Have you tried the original "Guess the number I'm thinking of" (Problem 44630)? This problem is just like that, except that the...

5 days ago

Solved


ICFP2021 Hole-In-Wall: Figure Validation
The ICFP held its annual 3-day contest in July 2021 with Hole-In-Wall. Contest Specification. The contest folds the figure in R...

5 days ago

Solved


Backgammon #2 - Your turn!
A previous problem in this occasional series (Problem 45967) set up a possible representation of a backgammon board: White ston...

5 days ago

Solved


Truncatable Primes
A truncatable prime is a leading digit is successively removed, then all resulting numbers are prime. Wiki When given a number...

5 days ago

Solved


Sort Except Zeros
Sort the numbers in a vector. But the position of zeros should not be changed. Example: sort_except_zeros( [5 3 0 0 2 4] ) == [...

5 days ago

Solved


Draw Letter 'L'

5 days ago

Load more