Ad
  • Default User Avatar

    Using CultureInfo.CurrentCulture.TextInfo.ToTitleCase is a good attempt to simplify capitalization, but it won’t fully work for Jaden Case in this context. ToTitleCase capitalizes the first letter of each word but does not affect subsequent letters. For example, ToTitleCase("hELLO wORLD") would result in "HELLO WORLD", which isn’t what Jaden Case requires. Jaden Case should only capitalize the first letter of each word and keep the rest in lowercase.

    To fix this, you can convert the phrase to lowercase first, ensuring only the first letter of each word is capitalized:

    CultureInfo.CurrentCulture.TextInfo.ToTitleCase(phrase.ToLower());

  • Default User Avatar
  • Custom User Avatar

    As the instructions said that name is a property of the object 'Players', Also we can't target the name of the player unless we use the Key Value which is the name: the structure is like that :
    Players[{name: "a"}, {name: "b"} ... {name: "z}];

  • Default User Avatar

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

  • Custom User Avatar

    Нужно добавить проверку на то что если input не array в самом начале, тогда если функция получает не массив то возвращает пустой массив.
    И дальше если нет еще, условия на 0, если элемент массива равен 0. В целом загвоздка для меня была только в первом условии, что было не прописано, что делать если функция получает не массив.
    /////
    It is necessary to add a check about what if input is not an array at the very beginning, then if the function does not receive an array, it returns an empty array. And then, a condition for 0, if the array element is 0 what you want function to do.
    In general, the only snag for me was in the first condition, what to do if the function does not receive an array.

  • Default User Avatar

    Не заданы условия, что должен возвращать код, при получении на вход нулевого массива.
    Итог на Java, не проходит 2 теста из 5, при проверке на нулевой массив и возрате такого же, не проходит 1 тест. И как годать?

  • Custom User Avatar
  • Default User Avatar

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

  • Default User Avatar

    I think it's more 7kyu than 8

  • Default User Avatar
    function countPositivesSumNegatives(input) {
      console.log(input);
      // your code here
    }
    
  • Default User Avatar

    Learning how to handle a null input and different outputs are both very useful, good exercise. More of a 7th level though.

  • Default User Avatar

    Same I also did this but with string since it's the return type and it wouldn't work so I wrote an if statement with the replace method inside instead.

  • Custom User Avatar

    how do we see the test case for the "Testing for wrong test 1"?

  • Custom User Avatar

    the 0 aren't count for the positive

  • Default User Avatar

    love the simplicity

  • Loading more items...