Magical Indices
Input
The first line of input contains an array
The second line of input contains a number
Output
The output should be a number indicating the number of valid positions
Explanation
For example, an array A = [10, 20, 30] and a value x = 25.
Sample Input 1
[1, 2, 3, 5, 7]
13
Sample Output 1
3
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString
.trim()
.split("\n")
.map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let integers = JSON.parse(readLine());
let value = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here and log the output */
}
product of array items
given an array integers, write a JS program to get the product of the given integers in the array
sample input1
[1,2,3]
sample output1
1*2*3 = 6
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString
.trim()
.split("\n")
.map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let integers = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here and log the output */
}
INPUT:
[1,2,3]
OUTPUT:
1*2*3 = 6
INPUT:
[-1,-2,-3]
OUTPUT:
-1*-2*-3 = -6 SHOULD BE LIKE THIS
two charges Q1=+3nC and Q2=-5nC are separated by a distance of 6cm and 2cm for point A amd 2cm and 10cm for point B (a) Calculate the electric potential at point A and point B.
(b) How much work is done by the electric field in a moving 4.00nC particle from point A and point B.
Discuss the health property of tea in terms of inhibition of starch digestions. What chemical entities and enzymes are involved? What is the health benefit from such action?
sketch the normal curve and find the area in each of the following cases
1. between z=-2.76 and z= -1.2
2. To the right of z=1.31
3. To the left of z=0.35
4.to the right of z= -0.95
calculate the amount of electric potential energy possesses by a 2.5x10^-10C at a point where electric potential is 4.70 volts?
Two systems have thermodynamic probabilities of 3.0×10^27 and 1.8×10^28 respectively. Calculate the entropies of the individual systems and as well as their composite system and verify the boltzmann relation.
What is the force of the gravity that is exerted on the Earth by the sun? The mass of the sun and earth are 1.99 × 10^30kg and 5.97×10^24kg respectively. The distance between the earth and tye sun is 1.496 × 10 ^11 m.
Four particle are to be distributed in 5 states. Calculate the number of ways in which this distribution can be done if the particles obey:
1) M-B statistics 2)B-E statistics.
When do we add the corresponding area of the z-score to 0.50?