GUVI
Back

TESTCASE SEEMS TO BE WRONG!

Created 2 years ago
87 Views
3 Comments
vigneshwarRV
@vigneshwarRV
vigneshwarRV
@vigneshwarRVProfile is locked. Login

I tried using airthmatic series in simple way but testcases keep failing..please clear me if I am wrong.

question :

Given 3 numbers A,B,C find the sum of Arithmetic Series with a=A, d=B and n=C
Sample Testcase :
INPUT
1 1 2
OUTPUT
3

code:

let a = userInput[0].split(' ').map(a=>+a);

let b = ((a[2]-1)*a[1])+ a[0];

console.log(b);

error :

Testcase Status:
>>> error
Input:
3 3 7
Expected Output:
84
Actual Output:
21

Comments (3)
Please login to comment.
 
Powered by habitate.io Habitate