Ad
  • Custom User Avatar

    The pair is not in sequential order, you would have to find them yourself, as written below...

    Trouble is that he mixed all the prices (initial and discounted), so now he needs your cool coding skills to filter out only the discounted prices.

  • Custom User Avatar

    Could someone explain me the problem that how the we are getting the ouput i am not able to understand @GiacomoSorbi or any one else and how the pair are forming

    input "15 20 60 75 80 100"

    for this pair of discount,initial can be 15 20 , 60 75 , 80 100

    so for this all the discount prices could be 15 , 60 , 80 so how the output is 15 ,60 ,75

    input 9 9 12 12 12 15 16 20

    for this pair of discount , initial will be 9 9 , 12 12 , 12 15 , 16 20

    so for this output will be 9 , 12 , 12 , 16 so how the output is 9 , 9 ,12 ,15

  • Custom User Avatar

    here how did u handeling the case when aug is negative and large enough such that p0 will never be able to reach p

  • Custom User Avatar

    Where do you see that if the two names have the same length you should return an empty array? Read the description again, if the names have a length of 4, then they are your friends and they should be in the output array.

  • Custom User Avatar

    For this question i have written the code but for this test case

    Testing for Ivan, Dick: expected [] to deeply equal [ 'Ivan', 'Dick' ]

    i am getting this but here as the two names have same length so we must return empty array and for this part i have written the logic so why my code is getting failed for this test case

  • Custom User Avatar

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