Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I thought my solution will be the dodgyest. :D

  • Custom User Avatar

    OK guys, I have solved it. So, I can clarify, that the challenge requires you to reverse the object key-string. No mirrored characters needed.

  • Custom User Avatar

    Yes, by the description it expects a reverse of the string, but when I run a test, there it seems to expect reverse string with mirrored characters. Probably the description should be clarified.

  • Custom User Avatar

    Okay, I got it, thank you. I'll try to solve it other ways.

  • Custom User Avatar

    I have solved the challenge with JavaScript.
    My solution gets green at initial Test, but at Attempt it times out and advises "assertSimilar is deprecated, use assertDeepEquals".
    I'm not sure, but maybe my solution times out because of the test's fault. Could someone confirm this, please?

  • Custom User Avatar

    Circumvent it.

  • Custom User Avatar

    Oh man! This one was challenging. It took me a week (and some Flector gel for my neck muscles), but I knew it, if I'll ever solve a 1 kyu kata, this one will be that, as Minesweeper was one of my favourite game back in win98 times and it doesn't need some twisted mind for solving it like for some other 1 kyu katas. I started to solve this challenge in a long and tiresome way, but as I went forward from the zero fileds to twos, threes and fours I gradually imporved my skills and came up with better and better, shorter ways. Then I realised, I could rewrite the beginning of my solution too, to make it shorter, and I could have reused some of my later applied functions, but it worked as it was, so I better left it as it was written at the first time. The whole code will be a memento of my improvement during the challenge. When I was at the final part, where only a few fields left unsolved I worried a bit because I have read here in the discussion that I can face performance issues, but luckily my solution went through the tests without any bigger problem. Sometimes it goes through all tests in 2,600ms. When I got more difficult random tasks, then even the 12,000ms wasn't enough though. I couldn't wait to see all green, but I can say, finally it worthed the effort and landed me in 2 kyu rank. The test results were a bit difficult to read sometimes because of the longer brown lines, but I liked the yellow-green-red evaluation. Thanks for the kata! Good job!

  • Custom User Avatar

    OK, it works! I didn't know I have to change the parsing engine at the top of the page with that button manually. Thank you.

  • Custom User Avatar

    Thanks. I think Object.fromEntries() still doesn't work. So, I got frustrated and tried to flatten my two-D array with .flat(), but that doesn't work either.

  • Custom User Avatar

    Hi all, so I tried to solve this challenge by first creating a two dimensional array of the necessary data. In the 2D array, each sub-array contained two elements, the zeroth element of the subarray was the key of the wished object and the first element of the subarray was the value of the wished object. So, it looked something like this: [[python, 1], [c, 2], [js, 1]]
    In the final step I tried to create the object from the 2D array with:

    const obj = Object.fromEntries(my2DArray);

    In VS Code, it works perfectly, the object is being created as expected, with key-value pairs from my 2D array. This idea was taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries

    However, here in Codewars this solution doesn't work, saying Object.fromEntries is not a function. Why is this?

  • Custom User Avatar

    There is some issue with the tests indeed, but it works well if you add an option for no Python developers in your solution.

  • Custom User Avatar

    Very well said! Thanks for your encouraging words!

  • Custom User Avatar

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

  • Custom User Avatar
  • Loading more items...