Solved


Split a given string from the first instance of a given character
A simple operation to split a given string into two substrings at the point where the desired character is first found. e.g. ...

10 months ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

10 months ago

Solved


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

10 months ago

Solved


Alternately upper-lower case
Modify the string to alternate between upper and lower case. For example, s='achyuta' output='AcHyUtA' Update - Test case...

10 months ago

Solved


Calculate days until Christmas
Provided with inputs year, month, day e.g. 2019,11,12, calculate the number of days until the next Christmas day, i.e. the next ...

10 months ago

Solved


Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

10 months ago

Solved


Find Month & day for given day number of a year
Find Month & day for given day number of a year (day number is any number ranging from 1 to 366)

10 months ago

Solved


Remove Missing Values from a Table or an Array
Remove missing entries from an array or table. If A is a vector, then remove any entry that contains missing data. If A is a mat...

10 months ago

Solved


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

10 months ago

Solved


"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) ...]...

10 months ago

Solved


Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

10 months ago

Solved


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

10 months ago

Solved


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

10 months ago

Solved


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

10 months ago

Solved


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

10 months ago

Solved


Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

10 months ago

Solved


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

10 months ago

Solved


Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

10 months ago

Solved


Find last zero for each column
Given a numeric array of arbitrary size, return the row index of the last zero for each column. If a column contains all nonzero...

10 months ago

Solved


Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

10 months ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

10 months ago

Solved


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] is s...

10 months ago

Solved


Return the first and last characters of a character array
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

10 months ago

Solved


Half-Swap
Given a vector with an even number of elements, rearrange it so that the elements in its first half are switched with those i...

10 months ago

Solved


Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').

10 months ago

Solved


Remove a specific character with another
Remove any (-) dash sign with (_) underscore Ex = 'The-Journey-of-thoudsands-miles-starts-with-a-single-step' y = 'The_Jour...

10 months ago

Solved


Swap between first and last
The idea is to swap between first and last row Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; ...

10 months ago

Solved


Swap between first and last column
The idea is to swap between first and last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 ...

10 months ago

Solved


Swap between rows
The idea is to swap between second and second last row Ex = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...

10 months ago

Solved


How Many Months Until It's Today Again?
Given a particular date, calculate how many months must pass before that same day of the month occurs on the same day of the wee...

10 months ago

Load more