Solved

N-Dimensional Sorting

Given two N-dimensional matrices A and B, first sort A in increasing order and then sort B with respect to the index of A. Y...

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

14 days ago

Solved

A sequence of Ones

You are given number(s) with all digits - 1. Your answer will depend on the count of 1 in the given number, for example - x1...

14 days ago

Solved

Hoax Numbers

A Hoax Number (OEIS A019506) is defined as a composite number, whose sum of digits is equal to the sum of digits of its distinct...

3 months ago

Solved

Perfect square.

Determine if the input is a perfect square or not. Example - If input is 25, return 1. If input is 17, return 0.

3 months ago

Solved

Which Prime

Given two prime numbers, specify the relation between them i.e. - 'Twin Prime', 'Cousin Prime', 'Sexy Prime' or 'None'

3 months ago

Solved

Draw a x-by-x matrix 'Denmark flag'(Euro(2020)

Draw a x-by-x matrix 'Denmark flag' using '4' and '1'.(x is odd and bigger than 4) Number 4: Caption S.Kjær and number 1: K.S...

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

3 months ago

Solved

Find the nth composite number.

Everyone heard about the nth prime number. Let's try to find out the nth composite. For example , 1 is the first composite, 10 i...

3 months 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] ) == [...

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

3 months ago