Probability of red tulips
I hope to give you bulbs of tulip. But I do not know the color of those petals. I just know that the color is red, white or yell...
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];
...
2ヶ月 前
解決済み
Step up
For given input array, output a array with all elements step up by two
Create a constant offset.
Add a constant offset to an array.
Example
a = [1 3 5 9]
offset = 2
y = [3 5 7 11]
2ヶ月 前
解決済み
Battery Charge Efficiency Calculation
In a Battery Management System (BMS), the efficiency of battery charging can be estimated using the formula:
where:
is the...
2ヶ月 前
解決済み
Number of 1s in a binary string
Find the number of 1s in the given binary string.
Example. If the input string is '1100101', the output is 4. If the input stri...
Calculate days until Christmas
Provided with inputs year, month, day e.g. 2019,11,12, calculate the number of days until the next Christmas day, i.e. the next ...