Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...
6ヶ月 前
解決済み
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...
6ヶ月 前
解決済み
特定の値がベクトル内に含まれているかを確認するコードを書こう
ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。
例:
a = 3;
b = [1,2,4];
スカラ値 3 はベクトル b に含まれていない...
6ヶ月 前
解決済み
Find the Best Hotels
Given three input variables:
hotels - a list of hotel names
ratings - their ratings in a city
cutoff - the rating at which yo...
6ヶ月 前
解決済み
Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...
6ヶ月 前
解決済み
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
a =...
6ヶ月 前
解決済み
Calculate Inner Product
Given two input matrices, x and y, check if their inner dimensions match.
If they match, create an output variable z which cont...