A résolu


Determine whether a number is practical
A number is practical if all smaller numbers can be written as a sum of the proper divisors of . The number 24 is practical bec...

2 mois il y a

A résolu


Generate the Figure-Figure sequence
After discussing Scott Kim’s FIGURE-FIGURE Figure (below) in Gödel, Escher, Bach, Douglas Hofstadter introduced an integer seque...

2 mois il y a

A résolu


Determine whether the input is an anagram number
In Cody Problem 44293, Mehmet OZC asks us to spell numbers as words. For example, 67 would be “sixty-seven” and 76 would be “sev...

2 mois il y a

A résolu


Damping of Servomotors with Tachometer Feedback
In Control Engineering, servomotors with tachometer feedback can be modeled by the second order system K / [J*s^2 + (B + K*K...

2 mois il y a

A résolu


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

2 mois il y a

A résolu


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. For...

2 mois il y a

A résolu


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identic...

2 mois il y a

A résolu


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE ...

2 mois il y a

A résolu


Getting the indices from a matrix
Inspired by Problem 645. Getting the indices from a matrix. Given a matrix A (or a vector), return the indices (always in row...

2 mois il y a

A résolu


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

2 mois il y a

A résolu


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

2 mois il y a

A résolu


Find the same and successive values in a vector
Find the same and successive values in a vector. For example: Input x = [ 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 ] Start and end...

2 mois il y a

A résolu


Longest Sequence of NaNs
In an array return the length of longest sequence of nans for each column. x = [ 2 3 1 2 5 6; nan nan 5 n...

2 mois il y a

A résolu


Combine Data With Gaps
Combine data sets a and b where the datasets have "gaps" or unique points. Example: Input a = [1,0; 2,1; ...

2 mois il y a

A résolu


Hard limit function
Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

2 mois il y a

A résolu


Identify eban numbers

2 mois il y a

A résolu


List the erauqs

2 mois il y a

A résolu


Find terms in the Connell sequence

2 mois il y a

A résolu


Generate a list of composite numbers

2 mois il y a

A résolu


Construct the Seidel-Entringer-Arnold triangle
Several problems in Cody ask us to construct part or all of triangles in which entries follow a pattern. Cody Problems <https://...

2 mois il y a

A résolu


Compute the harmonic numbers
The nth <https://mathworld.wolfram.com/HarmonicNumber.html harmonic number> is defined as the sum of the reciprocals of the inte...

2 mois il y a

A résolu


Find longest run
Write a function longest_run that takes as input an array of 0's and 1's and outputs the length and index of the longest consecu...

2 mois il y a

A résolu


Weave two matrices together to form one matrix
Take the first column from matrix a, then insert the first column from matrix b, and so on. For example: a = [1 2 3 4]; b ...

2 mois il y a

A résolu


Check if a rotated array was originally sorted
Suppose a sorted array is rotated at some pivot unknown to you. For example, |[0 1 2 4 5 6 7]| might become |[5 6 7 0 1 2 4]|. ...

2 mois il y a

A résolu


S-T-R-E-T-C-H I-T O-U-T
You will be given a row of numbers (x), and a single number (n). Your job is to write a script that will stretch out the row of...

2 mois il y a

A résolu


Zero Cross
Write a function that counts the number of times n a signal x changes sign. Examples x = [1 2 -3 -4 5 6 -7 8 -9 10 11] ...

2 mois il y a

A résolu


Look Up Mapping
Let the input is A = {[] [] [] [1] []}; B = {'A','B','C','D','E'}; Mapped Output = 'D';

2 mois il y a

Charger plus