A résolu


Find argmax of a function
You are given vectors x and y (=f(x)). Return the element of x for which f(x) is maximized.

plus de 7 ans il y a

A résolu


The Google Interview: Two Eggs Problem
Consider the following problem, a popular Google interview question: A firm has invented a super-strong egg. For publicity pu...

plus de 7 ans il y a

A résolu


Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...

plus de 7 ans il y a

A résolu


Find if a given sentence is a palindrome
Given a string/character array, return true if the string is a palindrome else returns false. For example: sample_text =...

plus de 7 ans il y a

A résolu


find the logic,easy one
find the logic behind, example x=18 y=306 x=53 y=2756

plus de 7 ans il y a

A résolu


Remove the air bubbles from a vector
_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

plus de 7 ans il y a

A résolu


Funny problems
Generate the following vector: if n=1 then q=1; elseif n=2 then q=[2 2 1]; elseif n=3 then q=[3 3 3 2 2 1]; ... end

plus de 7 ans il y a

A résolu


Bleed non-zeros to the right
What a title! Yet, it says what I mean. You get a vector, some values and a lot of zeroes. Every zero is replaced by the firs...

plus de 7 ans il y a

A résolu


Angle between Two Vectors
The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...

plus de 7 ans il y a

A résolu


cross in array
Make a cross from "1" in odd size array. Other value from array should be equal to "0"; As input you get length of side of arra...

plus de 7 ans il y a

A résolu


Feeling lucky?
Guess which number Cody is thinking (1 to 10)? (This is a game of luck more than skill. Good luck!)

plus de 7 ans il y a

A résolu


Sum of series VII
What is the sum of the following sequence: Σ(km^k)/(k+m)! for k=1...n for different n and m?

plus de 7 ans il y a

A résolu


convert the number to binary format & count digits
Convert the given number to the corresponding binary format and count the number of digits in that binary number

plus de 7 ans il y a

A résolu


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

plus de 7 ans il y a

A résolu


Percentage of zeros in a matrix of only 1s and 0s
Write a function called _zero_stat_ that takes a matrix as an input that only has 0 and 1 elements. The function needs to comput...

plus de 7 ans il y a

A résolu


Basic Quadratic Equation
Create the equation: y=(3x)^2+(5x)+35 and compute y for various values of x

plus de 7 ans il y a

A résolu


Prime Product
My professor has given a sequence of N numbers as a1, a2, ..., aN and asked me to find the smallest possible value of ai * aj su...

plus de 7 ans il y a

A résolu


how many of the entries are positive?
Given x= sin(linspace(0,10*pi,100)), how many of the entries are positive?

plus de 7 ans il y a

A résolu


Test if a number is numeric or not
Test if a number is numeric or not

plus de 7 ans il y a

A résolu


Was ist denn los?
Nur für deutschsprechende Leute! Wie geht's? ...also gut, bis bald!

plus de 7 ans il y a

A résolu


Counting votes
x is a vector of votes, e.g. x=[1 2 3 2 2 1 3 2 1 2 2 2 2], who is the winner? 1,2,3?

plus de 7 ans il y a

A résolu


Remove the middle element from a vector
Remove the middle element of a vector? *Example:* [1,2,3] should return 2 [1,2,3,4] should return 2 [] should return...

plus de 7 ans il y a

A résolu


Finding two missing number in 1 to n array
You are given an array of numbers from 1 to n with two missing numbers. Return the two missing numbers. Input: x=[5 2 0 1 ...

plus de 7 ans il y a

A résolu


Find 100 from a Matrix and Replace With 0 with less computation time
pls use this matrix x = [208 40 167 180 112 70 192 215 90 19 231 100 9 100 97 100 ...

plus de 7 ans il y a

A résolu


Find Euclidean norm of given vector u.
Find Euclidean norm of given vector u. https://en.wikipedia.org/wiki/Euclidean_distance Example x=[1 1] result=sqrt(1^2+1^2...

plus de 7 ans il y a

A résolu


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

plus de 7 ans il y a

A résolu


Second smallest number
What is the second smallest number in x? example: x = [1 2 3 4 5 6 7 8 9] y = 2

plus de 7 ans il y a

A résolu


Count number of words in string
Count number of words in string Examples 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3

plus de 7 ans il y a

A résolu


Remove and Sort
Given a randomized array n, sort it and remove all odd integers. n=5 y = [2 4]

plus de 7 ans il y a

A résolu


Initialize a Natural Number matrix.
Given length of matrix initialize a matrix consisting of natural numbers from 1 to n: n = 10; x = [ 1 2 3 4 5 6 7 8 9 10]; ...

plus de 7 ans il y a

Charger plus