Risolto


Hofstadter G sequence
The Hofstadter G sequence is defined as follows: The first elements of the sequence are 0, 1, 1, 2, 3, 3, 4, 4, 5, 6. Write ...

circa 2 anni fa

Risolto


Hofstadter Female and Male sequences
The Hofstadter Female (F) and Male (M) sequences are defined as follows Write a function to compute for a given n. See http...

circa 2 anni fa

Risolto


Hofstadter H sequence
The Hofstadter H sequence is defined as follows: The first elements of the sequence are 0, 1, 1, 2, 3, 4, 4, 5, 5, 6. Write ...

circa 2 anni fa

Risolto


Hofstadter Q sequence
The Hofstadter Q sequence is defined as follows: The first elements of the sequence are 1, 1, 2, 3, 3, 4, 5, 5, 6, 6. Write ...

circa 2 anni fa

Risolto


Draw a Diamond shape in ones Matrix with '0' s
Input will be odd numbers.The task is to make a Diamond shape in a ones matrix with '0's where the matrix will be a square matri...

circa 2 anni fa

Risolto


Calculate the peak value of square wave
Given the peak value of sine wave, calculate corresponding peak value of square wave, if both have same RMS voltage.

circa 2 anni fa

Risolto


Calculate the integral of the polynomial
for e.g. in = [3 2 1] out = [1 1 1 0]

circa 2 anni fa

Risolto


Return the middle element of an NxN square matrix where N is odd
Let's say you are given an NxN square matrix where N is always going to be an odd number: x = [ 1 2 3 4 5 6 7 8 ...

circa 2 anni fa

Risolto


The Ulam Matrix
The Ulam spiral is simple to describe. On a gridded piece of paper, write down the number 1. Then write successive integers as y...

circa 2 anni fa

Risolto


Sum of diagonals
Compute the sum of diagonal elements of a square matrix and store the larger sum to s. Eg : a = [1 2 3; 2 3 4; 4 5 10] ...

circa 2 anni fa

Risolto


Delete the column with all 0 !
Delete the column with all 0 data in a matrix(x). e.g. input x = 1 0 0 4 5 0 7 0 ...

circa 2 anni fa

Risolto


Average of odd values
Find the average of odd values in given a matrix. e.g x=[ 4 11 8 ; 9 2 7 ] y =( 11 + 9+ 7 ) / 3

circa 2 anni fa

Risolto


Create a magic square matrix for a given odd integer
A magic square of size 'N' is a matrix that satisfies the following criterias: # Dimension - NxN # Matrix should contain ALL...

circa 2 anni fa

Risolto


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

circa 2 anni fa

Risolto


Vertical matrix sort
Given a matrix x with n rows and m columns, return a matrix y with 2n rows and m columns, such that every column in x is sorted ...

circa 2 anni fa

Risolto


Basic Operation with the middle number of odd matrix
# Take an odd matrix *like* 3-by-3 # Access the *middle element* of the matrix i.e in case of 3-by-3 matrix the index of the pa...

circa 2 anni fa

Risolto


The maximum sum of squares
Create a function file with an input maxval to determine the maximum number of terms for the series 1^2 + 2^2 + 3^2 + ... such t...

circa 2 anni fa

Risolto


Calculate the area of a circle
Given a circle of diameter x calculate its area

circa 2 anni fa

Risolto


Find the area of ​​the square
There are *n²* circles inscribed in the square ABCD. The perimeter of each circle is *aπ* <<http://imgfz.com/i/3wzCeAT.png>> ...

circa 2 anni fa

Risolto


function to compute root mean square of first nn positive odd integers
Write a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive ...

circa 2 anni fa

Risolto


Squares of odd numbers upto a given range
Find the squares of odd numbers upto a given range. If Given x=6 return y=(1^2,3^2,5^2) y=1,9,25 If Given x=5 retu...

circa 2 anni fa

Risolto


Get the area of ​​the square.
Four circles are inscribed in the square ABCD. The perimeter of each circle is *aπ*. <<http://imgfz.com/i/UzgCJut.png>> Gi...

circa 2 anni fa

Risolto


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

circa 2 anni fa

Risolto


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

circa 2 anni fa

Risolto


odd number odd sum
How many three digit numbers are there whose sum of the digits is odd?

circa 2 anni fa

Risolto


Find the number of rectangles
There is a m*n grade given. Find the number of rectangles in the grid. Remember, a square is also a rectangle.

circa 2 anni fa

Risolto


Do the line-segments intersect?
You are given two line segments. Do they cross? Consider one segment as (x1,y1) to (x2,y2), the other segment as (x3,y3) to (x4...

circa 2 anni fa

Risolto


exactly?
given two strings of numeric expressions such as '1-7/14' and '11/22+0.2^2', return 1 if they are numerically exactly equal othe...

circa 2 anni fa

Risolto


calculate Compound Intrest
Calculate Compound Intrest for given data

circa 2 anni fa

Carica altro