K is the position of the digit of Pi your code should return. It is zero-indexed, if k is 0, then your code should return 3, read the description again. It's all there.
Good lord that took me HOURS to work out. A nice easy 7 kyu that won't take long I thought. How wrong I was.
Looks like I ended up with some massively overcomplicated formula compared to others looking at the solutions, but still works. Could have probably reduced it down but I was a bit sick of it by the end.
enough suffering... kill the loops... giving up before googling the master formula that im sure is over there... but i really like the challenge. Congrats!
.. btw I reach a solution not good enough for the extreme case in ejecution time...
I had to remember the lessons of mathematics and again derive formulas. Of course, you can look for ready-made formulas, but this is not the way of the Jedi)
Seccessfuly pass all the tests in c++
I got 5295ms
I was able to solve this problem using brute-force (linear time complexity),
but I can see some better math solutions here :)
Very fancy kata of the mathematical series.
not a question.
K is the position of the digit of Pi your code should return. It is zero-indexed, if k is 0, then your code should return 3, read the description again. It's all there.
HI everyone,
What means k,
what should i make in this Kata
Me also
Good lord that took me HOURS to work out. A nice easy 7 kyu that won't take long I thought. How wrong I was.
Looks like I ended up with some massively overcomplicated formula compared to others looking at the solutions, but still works. Could have probably reduced it down but I was a bit sick of it by the end.
Just solved it.
The formula might be confused a little bit.
enough suffering... kill the loops... giving up before googling the master formula that im sure is over there... but i really like the challenge. Congrats!
.. btw I reach a solution not good enough for the extreme case in ejecution time...
I'm not sure what the question is.
It's definitely not impossible...
This kata seems impossible. Too invested to ignore it.
Is it too much to ask why 0 => 7 and 1 => 4 ? Sry but the description is too ambiguous for me.
I had to remember the lessons of mathematics and again derive formulas. Of course, you can look for ready-made formulas, but this is not the way of the Jedi)
Loading more items...