Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the Nth prime numb...
3年弱 前
解決済み
英語の文章内の母音を取り除くコードを書きましょう。
与えられた英語の文章内の母音を取り除きましょう。
例:
入力 s1 が 'Jack and Jill went up the hill' の場合、
出力 s2 は 'Jck nd Jll wnt p th hll'
* (英語版) ...
3年弱 前
解決済み
ゼロでない要素が一番多い行を探そう
行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。
例:
入力として、行列
a = [ 1 ...
Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series:
pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...
For a given number of...
3年弱 前
解決済み
Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...
3年弱 前
解決済み
Pi Estimate 1
Estimate Pi as described in the following link:
<http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>
3年弱 前
解決済み
row removal
Remove the nth row from input matrix M and return the resulting matrix in output N.
Weave two vectors into one
Weave the two given vectors into one as shown below.
Example:
If
a = [1 1 1]
b = [0 0 0]
then
y = [1 0 1 0 ...
3年弱 前
解決済み
Put Two 1D matrices into one 1D matrix
Example:
If
input a = [1 2 3 4 5];
input b = [10 9 8 7 6];
then output will be,
y_correct = [1 10 2 9 3 8 4 7 5...