Ad
  • Custom User Avatar

    The purpose of the function you're writing is to return the nth Fibonnacci term.
    "nth_fib(1)" he expects "0" as an answer; 0 is the 1st term in the sequence.
    "nth_fib(4)" he expects "2"; similarly, 2 is the 4th term in the sequence.
    Consequently, provided n, return the nth number of the Fibonnacci sequence.

  • Default User Avatar

    Hi there! The 8 is the count of how many numbers meet the criteria while 118 is the lower bound of the eight numbers and 334 is the upper bound. In other words, if you find all the numbers and put them in an array A = [118, 127, 136, 145, 226, 235, 244, 334], then the answer is [length(A), min(A), max(A)]

  • Custom User Avatar

    No:

    The first and last elements of the array will not be considered as peaks (in the context of a mathematical function, we don't know what is after and before and therefore, we don't know if it is a peak or not).

  • Custom User Avatar

    Read the title and the kata description again.

  • Custom User Avatar

    he means -2 + 1 = -1, this sum is less than 6,
    the largest sum (when adding adjacent indices is 6 = 4 + (-1) + 2 + 1)

  • Custom User Avatar

    Definitely not a kata issue. Please read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution specially how to post a code block, in-line code in Python is very hard to read.

  • Default User Avatar

    the question ask you to write a method to find the linges palindrome form the given string
    palindrome is if a word is read in reverse string it spells the same
    example abba - is same if read in reverse

    so if a string is given as "hello world abba, that is kayak"
    in here there are 2 palindrome (substring) abba and kayak but the longest one is kayak (length of 5)

    so writing a function to find the longest palindrome and return it

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Basically the kata is asking for the subarray aka values that are next to each other in terms of indexes sum that is the greatest sum
    for example
    {-2,1} or -1 < 6 aka(4-1,2,1)
    -2+1+-3+4-1+2+1-5+4 < 6
    and so on

  • Custom User Avatar

    Not a kata issue, your function doesn't return in the first sample test.