Statistics
RANK
N/A
of 300,840
REPUTATION
N/A
CONTRIBUTIONS
0 Questions
0 Answers
ANSWER ACCEPTANCE
0.00%
VOTES RECEIVED
0
RANK
of 21,092
REPUTATION
N/A
AVERAGE RATING
0.00
CONTRIBUTIONS
0 Files
DOWNLOADS
0
ALL TIME DOWNLOADS
0
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
0 Discussions
AVERAGE NO. OF LIKES
Feeds
Solved
Find primes and integers that solve an equation
Write a function to find all primes and non-negative integers that solve the equation where is an integer. If there are no...
2 hours ago
Solved
Compute a sequence with the whyphi sieve
A few problems on Cody involve sieving. For example, Cody Problem 45367 involves the famous Sieve of Eratosthenes. CP 50811 uses...
2 hours ago
Solved
Remove the diagonal of a square matrix
Some Cody problems ask solvers to remove columns (e.g., CP 7), and others ask solvers to remove rows (e.g., CP 44033). Write a...
3 hours ago
Solved
Extract numbers using a decaying sieve
The Sieve of Eratosthenes is one method of determining primes. Starting with 2, one keeps 2 and removes 2x2, 3x2, 4x2, etc. Then...
4 hours ago
Solved
Pascal's Pyramid - A Variation with an Arial View
Let's create a matrix of size N x N containing a Pascal's Triangle in each quadrant that diverges from the centre to form an ari...
1 day ago
Solved
Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You m...
1 day ago
Solved
Container With Most Water
You are given an integer array height . There are vertical lines drawn such that the two endpoints of the ith line are (i, 1) an...
1 day ago
Solved
Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...
2 days ago
Solved
Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...
2 days ago
Solved
Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...
2 days ago
Solved
Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...
2 days ago
Solved
Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...
2 days ago
Solved
Relative ratio of "1" in binary number
Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...
2 days ago
Solved
Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...
2 days ago
Solved
Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.
2 days ago
Solved
There are 10 types of people in the world
Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...
2 days ago
Solved
Pascal's Triangle
Create a matrix of size N x N containing a Pascal's Triangle that starts from the upper left corner according to the test cases ...
2 days ago
Solved
Convert a diagonal representation of a matrix element to linear index or subscripts
Elements in matrices in MATLAB can be retrieved by linear index or subscripts. For example, the 1 in the matrix below has a line...
2 days ago
Solved
Determine whether a number is a repfigit number
A sequence of numbers is constructed from a number with the following steps: List the digits of . Compute the ()st term as t...
2 days ago
Solved
Fermat primes
Historical context The french mathematician Pierre de Fermat found the formula to find some prime numbers. He thought / co...
3 days ago
Solved
Ulam primes second formula
Historical context The polish-american mathematician Stanislaw Ulam found the formula to give some prime numbers not given...
3 days ago
Solved
Ulam primes first formula
Historical context The polish-american mathematician Stanislaw Ulam found the formula to give the first 760 prime numbers ...
3 days ago
Solved
チェッカーボードを作ろう
整数 n が与えられた時、以下の様な1と0を含むn×nの行列を作成しましょう。a(1,1) は1にする必要があります。 例: 入力 n = 5 出力 a が [1 0 1 0 1 0 1 0 1 0 ...
3 days ago
Solved
文字列の最初と最後の文字だけ抜き出しましょう。
文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。 もし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。 例: stringfirstandlast('borin...
3 days ago
Solved
対称で、n*2n のサイズの行列を作成しましょう
サイズが n*2n の "mirror" 行列(対称行列)を作成しましょう。 例: n=2 の場合、以下のような出力を返します。 m = [ 1 2 2 1 1 2 2 1 ] n = 3 の場合、以下のよう...
3 days ago
Solved
英語の文章内の母音を取り除くコードを書きましょう。
与えられた英語の文章内の母音を取り除きましょう。 例: 入力 s1 が 'Jack and Jill went up the hill' の場合、 出力 s2 は 'Jck nd Jll wnt p th hll' * (英語版) ...
3 days ago
Solved
テレビのサイズを求めてみよう
あなたは電気屋で働いています。 あなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。 しかし、テレビのインチを知るには、幅と高さの情報が必要です。 ...
3 days ago
Solved
NaN (欠損値) が含まれている行を削除しよう
行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。 例: A = [ 1 5 8 -3 NaN 14 ...
3 days ago
Solved
特定の値がベクトル内に含まれているかを確認するコードを書こう
ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。 例: a = 3; b = [1,2,4]; スカラ値 3 はベクトル b に含まれていない...
3 days ago
Solved
ゼロでない要素が一番多い行を探そう
行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。 例: 入力として、行列 a = [ 1 ...
3 days ago











