We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There is math involved for sure, But real-world programming rarely or Never involves a task like the one described in the highly-contrived problem.
Anyways: A simple rule should be observed.... If you want to write a math problem, your own math and use of mathematical language should be written as a Clear, and sensical question using conventional language and notation.
Although the main contention with this problem is that the language is a bad explanation of what answers are to be provided by the solution.
The authors printed some formulae in the description but used an informal approach. They also used the word "series" incorrectly.
"print the series corresponding to the given a, b, and n
values as a single line of n space-separated integers."
Since a series is by definition "An Infinite sum", "Printing a series as a sequence of integers" is nonsensical.
Frankly, at first glance, the notation used is a bit wonky. Usually you also don't use commas to separate your partial sums; You would list them on separate lines.
It's not clear from the question statement that the author is in fact even looking for the list of partial sums from 1 up to N, and that N is also the number of terms. You have to read between the lines.
Finally, After the end of the problem description and start of the Input Format, here comes an unexplained value called "q" for "Number of queries", Which seems superfluous, since the problem statement above did not mention how this is to be used.
So you're essentially left coming up with a theory on what the problem is to be solved, And testing a bunch of mathematics out on paper to see if the sample inputs and outputs agree with what you think they wanted to say they wanted.
For real-world programming: usually, when anything beyond simple arithmetic is involved in terms of math, this will be math that the programmer has constructed or processed on their own to efficiently solve a problem --- in some cases you may have a formula to evaluate With user-provided inputs, rarely you might even have an iterative process to evaluate to achieve a summary result, But in the real world they're sure as hell not going to ask you for terms of a series you are computing; not unless you're stepping through it for debugging or in a programming domain specialty is developing mathematical modeling equations, or something similar as that.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Loops II
You are viewing a single comment's thread. Return to all comments →
There is math involved for sure, But real-world programming rarely or Never involves a task like the one described in the highly-contrived problem.
Anyways: A simple rule should be observed.... If you want to write a math problem, your own math and use of mathematical language should be written as a Clear, and sensical question using conventional language and notation.
Although the main contention with this problem is that the language is a bad explanation of what answers are to be provided by the solution.
The authors printed some formulae in the description but used an informal approach. They also used the word "series" incorrectly.
Since a series is by definition "An Infinite sum", "Printing a series as a sequence of integers" is nonsensical.
Frankly, at first glance, the notation used is a bit wonky. Usually you also don't use commas to separate your partial sums; You would list them on separate lines.
It's not clear from the question statement that the author is in fact even looking for the list of partial sums from 1 up to N, and that N is also the number of terms. You have to read between the lines.
Finally, After the end of the problem description and start of the Input Format, here comes an unexplained value called "q" for "Number of queries", Which seems superfluous, since the problem statement above did not mention how this is to be used.
So you're essentially left coming up with a theory on what the problem is to be solved, And testing a bunch of mathematics out on paper to see if the sample inputs and outputs agree with what you think they wanted to say they wanted.
For real-world programming: usually, when anything beyond simple arithmetic is involved in terms of math, this will be math that the programmer has constructed or processed on their own to efficiently solve a problem --- in some cases you may have a formula to evaluate With user-provided inputs, rarely you might even have an iterative process to evaluate to achieve a summary result, But in the real world they're sure as hell not going to ask you for terms of a series you are computing; not unless you're stepping through it for debugging or in a programming domain specialty is developing mathematical modeling equations, or something similar as that.