There is an array with some numbers. All numbers are equal except for one. Try to find it!


Kata.findUniq(new double[]{ 1, 1, 1, 2, 1, 1 }); // => 2

Kata.findUniq(new double[]{ 0, 0, 0.55, 0, 0 }); // => 0.55

It’s guaranteed that array contains more than 3 numbers.


The tests contain some very huge arrays, so think about performance.




# Sort the odd


You have an array of numbers.

Your task is to sort ascending odd numbers but even numbers must be on their places.


Zero isn't an odd number and you don't need to move it. If you have an empty array, you need to return it.


Example


sortArray([5, 3, 2, 8, 1, 4]) == [1, 3, 2, 8, 5, 4]



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!



매일 코딩을 하기위해서 이것 저것 해보다가 업무나 일상에서 떠오르는 문제는 한계가 있고

오일러를 몇개 풀어봤는데 코딩보다는 수학을 잘해야되는구나 싶어서..... 고민중에 추천 받은


Codewas


비슷한 사이트인 hackerrank도 알고 있었지만 입,출력을 직접 코딩하지 않아도 되는점이 참 맘에들어서 결정


목표 :  5문제/주 - 평일에 1문제씩 풀고 어려워서 못푼문제는 주말에 푼다.




+ Recent posts