Community Profile

photo

ksam K


Last seen: oltre 3 anni fa Attivo dal 2017

Statistiche

All
  • CUP Challenge Master
  • Commenter
  • First Answer
  • Solver

Visualizza badge

Content Feed

Visto da

Risolto


Recaman Sequence - I
Recaman Sequence (A005132 - <http://oeis.org/A005132 - OEIS Link>) is defined as follow; seq(0) = 0; for n > 0, seq(n) ...

oltre 6 anni fa

Risolto


Recaman Sequence - II
Take an arbitrary starting point as input and create Recaman Sequence. Then find the 1, return its index. For example: if n =...

oltre 6 anni fa

Risolto


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

oltre 6 anni fa

Risolto


I Plead the Fifth
Write a function to provide a yes or no answer to the input string. However, it must plead the 5th amendment (return an empty st...

oltre 6 anni fa

Risolto


A Simple Tide Gauge with MATLAB
*&#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767* You are standing in a few inches of sea water on a beach. You a...

oltre 6 anni fa

Risolto


Find nearest prime number less than input number
Find nearest prime number less than input number . For example: if the input number is 125, then the nearest prime number whi...

oltre 6 anni fa

Risolto


Find the nearest prime
Given a positive integer 'n', the task is to find a prime number greater than or equal to 'n'. Example 1 If given 'n' is ...

oltre 6 anni fa

Risolto


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

oltre 6 anni fa

Risolto


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

oltre 6 anni fa

Risolto


Pentagonal Numbers
Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

oltre 6 anni fa

Risolto


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

oltre 6 anni fa

Risolto


Basic electricity in a dry situation
&#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#...

oltre 6 anni fa

Risolto


MATLAB Counter
Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b. E...

oltre 6 anni fa

Risolto


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

oltre 6 anni fa

Risolto


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

oltre 6 anni fa

Risolto


Multiply by 3
Given the variable x as your input, multiply it by three and put the result in y.

oltre 6 anni fa

Risolto


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

oltre 6 anni fa

Risolto


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

oltre 6 anni fa

Risolto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

oltre 6 anni fa

Risolto


Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

oltre 6 anni fa

Risolto


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

oltre 6 anni fa

Risolto


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

oltre 6 anni fa

Risolto


Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

oltre 6 anni fa

Risolto


Is it really a 5?
A number containing at least one five will be passed to your function, which must return true or false depending upon whether th...

oltre 6 anni fa

Risolto


How to subtract?
*&plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn* * Imagine you need to subtract one...

oltre 6 anni fa

Risolto


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

oltre 6 anni fa

Risolto


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

oltre 6 anni fa

Risolto


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

oltre 6 anni fa

Risolto


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

oltre 6 anni fa

Risolto


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

oltre 6 anni fa

Carica altro