Resuelto


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

3 meses hace

Resuelto


Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

3 meses hace

Resuelto


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

3 meses hace

Resuelto


Probability of red tulips
I hope to give you bulbs of tulip. But I do not know the color of those petals. I just know that the color is red, white or yell...

3 meses hace

Resuelto


Maximum Intra-Vector Swaps
This Challenge, based upon a contest in which Rokicki came in 2nd, is to find sequences containing 1:N that require maximum iter...

3 meses hace

Resuelto


Given a number between 1-365 (a day number in a non leap year) , find what day of what month it is.
For a given number between 1-365 (a day number in a non leap year), you should check which day of which month it is. for exampl...

4 meses hace

Resuelto


Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

4 meses hace

Resuelto


Pentagonal dodecahedron
<<https://upload.wikimedia.org/wikipedia/commons/7/73/Dodecahedron.gif>> Pentagonal dodecahedron is a dodecahedron that is ...

4 meses hace

Resuelto


How many revolutions around the earth
Calculate how many revolutions you will around the earth till 1/1/2100. Given the birhdate find your age in number of days on 1...

4 meses hace

Resuelto


GCD

4 meses hace

Resuelto


Primes Checker
Given variable inputs Check if they are prime numbers

4 meses hace

Resuelto


Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3. M = [1 2 3;4 5 6;7 8 9]; ou...

4 meses hace

Resuelto


Sum of diagonals elements of a matrix
Given a matrix, return the sum of all the elements across the diagonals. E.g. A = [1 2 3; 4 5 6; 7 8 9;...

4 meses hace

Resuelto


house of cards
How many cards do one need to build a house of cards with n stages? Short explanation: /\ 2 cards for 1 stage ...

4 meses hace

Resuelto


balance vector
Given a non-empty vector x with integer elements. x shall be called balance vector if one can split the elements of x into two g...

4 meses hace

Resuelto


Prime Product
My professor has given a sequence of N numbers as a1, a2, ..., aN and asked me to find the smallest possible value of ai * aj su...

4 meses hace

Resuelto


Only once: cleaning up your columns
We have a logical array (with ones and zeroes). It is simple: after processing every column may only contain a single true value...

4 meses hace

Resuelto


Calculate the sum of first x natural numbers
Calculate the sum of first x natural numbers for example if n=10 output =1+2+..+10=55

4 meses hace

Resuelto


Aquiles y la tortuga
Contaba Zenón en su famosa paradoja que un día Aquiles, el guerrero griego más veloz de la Hélade, se enfrentó a una pequeña tor...

4 meses hace

Resuelto


Draw 'Y'
Draw 'Y' in an x-by-x matrix (where x is odd and x >= 3) Examples: x = 3 y = [1 0 1 0 1 0 0 1 0] x = 5 y = [1...

4 meses hace

Resuelto


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

4 meses hace

Resuelto


Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

4 meses hace

Resuelto


count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...

4 meses hace

Resuelto


Check if is a square
Given four coordinates, write a function to check if they form a square on the XY plane.

4 meses hace

Resuelto


Combined Ages 1 - Symmetric, n = 3
You have probably seen the common riddle wherein combined ages are provided and you must determine the individual ages. For exam...

4 meses hace

Resuelto


COUNT VOWEL 2
The objective of this problem is to determine the number of unique vowels used in the given string. Now count vowels in STRI...

4 meses hace

Resuelto


Red Cross ❌

4 meses hace

Resuelto


Cull vector elements that contain a specified digit
Given inputs of (1) a row vector and (2) a digit, identify the elements of that vector that contain the digit, remove them, and ...

4 meses hace

Resuelto


Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

4 meses hace

Resuelto


One-hot encoding

4 meses hace

Cargar más