2018.03.20


#Sum of the first nth term of Series 


Your task is to write a function which returns the sum of following series upto nth term(parameter).


Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +...


Rules:

- You need to round the answer to 2 decimal places and return it as String.

- If the given value is 0 then it should return 0.00

- You will only be given Natural Numbers as arguments.


Examples:

SeriesSum(1) => 1 = "1.00"

SeriesSum(2) => 1 + 1/4 = "1.25"

SeriesSum(5) => 1 + 1/4 + 1/7 + 1/10 + 1/13 = "1.57"



2018.03.19


#Find the missing letter


Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.


You will always get an valid array. And it will be always exactly one letter be missing. The length of the array will always be at least 2.

The array will always contain letters in only one case.


Example:


['a','b','c','d','f'] -> 'e'

['O','Q','R','S'] -> 'P'


(Use the English alphabet with 26 letters!)


Have fun coding it and please don't forget to vote and rank this kata! :-)


I have also created other katas. Take a look if you enjoyed this kata!



+ Recent posts