4 kyu

The observed PIN

10,464 of 38,754BattleRattle
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • sneekyfoxx Avatar
    ('369', [
        "339","366","399","658","636","258","268","669","668","266","369","398",
        "256","296","259","368","638","396","238","356","659","639","666","359",
        "336","299","338","696","269","358","656","698","699","298","236","239"
    ])
    

    How is '666' there but not '333'? Each digit is counted as its own adjacent digit as well. I'm lost as to what is actually happening. This kata is a mix of finding adjacent digits as well as finding the possible combinations involving each digit but what's expected is highly inconsistent. Idc how many completions it has the expectations are not inline with the task description.

  • sneekyfoxx Avatar

    ('11', ["11", "22", "44", "12", "21", "14", "41", "24", "42"])
    24 is a diagonal and so is 42. 2 and 4 are not adjacent to one another. It defeats the horizontal and verticle rules.

    It should be: ('11', ["11", "22", "44", "12", "21", "14", "41"])

  • Owltooth Avatar

    Thank you

  • aiguobian Avatar

    I am passing most of the test until the timeout error. Can Anyonce give me some clue on how to improve the running effeciency?

  • luinal Avatar

    Getting this error in the final test: Pin: '47784068' STDERR Max Buffer Size Reached (1.5 MiB)

  • Varaniy Avatar

    Can anyone tell me, please, is the execution time of 1445 ms good for this task or is it still slow?

  • Alan-Turing13 Avatar

    A note if you're doing this in Java, make sure to return an ArrayList to avoid the UnsupportedOperationException. Great work on the kata!

  • jediflamaster Avatar

    I am cyberdetective!

  • greg-Da Avatar

    This comment has been hidden.

  • trashy_incel Avatar

    assertion messages for the PHP random tests are completely unhelpful: Failed asserting that false is true

  • TERNION2205 Avatar

    This comment has been hidden.

  • AFireInside777 Avatar

    Hello, just trying to understand the variations. For this test example: "369": ["339","366","399","658","636","258","268","669","668","266","369","398","256","296","259","368","638","396","238","356","659","639","666","359","336","299","338","696","269","358","656","698","699","298","236","239"], how come 222 and 333 are not variations? Or 555? Or 325? But I see that 666 is there?

  • Sagar_adhikari Avatar

    This comment has been hidden.

  • cwps Avatar

    JavaScript fork for adding random tests.

  • Grecks Avatar

    This kata has been much more fun than I initially thought it would!

  • SS-Stefanov1 Avatar

    I really need to learn how to write more efficiently..

    Solutions works, but timeout's for larger 7+ digit inputs.. :(

  • Miguel Pérez Avatar

    Shame to the guys who assumed the adjacent relationship instead of infering them from the keyboard. What will happen if the given keyboard's keys change position or the layout is a different one? You will have to redo manually your funny hard coded dictionaries / lists. For this challenge to be real, both inputs must be the observed digits and the layout of the keyboard.

  • Osama Mohamed Avatar

    it gives me this error : Test Failed PIN: [8, System.String[]] Expected: equivalent to < "5", "7", "8", "9", "0" > But was: < "5", "7", "9", "0" > Missing (1): < "8" >

  • zjt-code Avatar

    Anyone know why this error?

    Test Crashed Caught unexpected signal: SIGSEGV (11). Invalid memory access.

  • mauacs Avatar

    Where in the instruction says that an observed sequence of '11' could be a result of a real one-digit action in digit '2'?

    One of the JS test expects exactly that.

    I'm really confused. Any help?

  • Zanamo Avatar

    12 test cases for javascript? make 300 hundred cases

  • ichangbr Avatar

    Gives this error: Traceback (most recent call last): File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper func() File "/workspace/default/tests.py", line 12, in it1 test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'PIN: ' + tup[0]) ^^^^^^^^^^^^^^^^^^^^^^^^

  • hexolio Avatar

    Hey all! I made a Julia translation. Would appreciate it if any reviewers who are fellow Julia fans could take a look.

  • KayleighWasTaken Avatar
  • Eatkin Avatar

    This Kata made me realise how much better I've got at programming these past few months. 4 kyu used to scare me off, but this one took maybe 10 minutes and I immediately went for a depth search algorithm. Nice tidy solution (if I do say so myself) and I only failed test cases once because of a minor typo.

  • Quark Fox Avatar

    Nice kata!!

  • kpnr Avatar

    It's very strange. But why so few people make a generative mapping from observed to possible digits? May be add a new input arg with PIN-pad mapping to next version of kata. Like get_pins(['012','345','678',' 9 '], '911')...

  • Wint57 Avatar

    Hello! I have found bug for java script language: Testing PIN='2' needs array of 4 elements, but for digit 2 we have to get only 3 digit

  • pcyanide Avatar

    Function 'free_pins' in C implementation requires also an argument 'count' (returned by function 'get_pins'), specifying the number of pin compibations.

  • bglamb Avatar

    This comment has been hidden.

  • Peio47 Avatar

    Hi, I've got the good answer, but in a different order and it doesn't want to validate....

  • AdiPassover Avatar

    This kata is very fun :)

  • mmos0123456 Avatar

    Amazing kata! Although my solution wasn't as smooth as the others, the end result was satisfying.

  • Madotson Avatar

    This comment has been hidden.

  • Nahkela Avatar

    I don't how, BUT IT WORKS, i am so happy

  • vldmr.py Avatar

    This comment has been hidden.

  • MaximPrudnikau Avatar

    tests/Fixture.cs(41,29): error CS1061: 'IList' does not contain a definition for 'Sort' and no accessible extension method 'Sort' accepting a first argument of type 'IList' could be found (are you missing a using directive or an assembly reference?)

    Error in C# attempt tests

  • Pverte Avatar

    I've got this error for the test, it should be changed :

    Traceback (most recent call last): File "/workspace/default/tests.py", line 10, in test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'PIN: ' + tup[0]) TypeError: 'NoneType' object is not iterable

    (Edit : changed because the markdown style didn't want to put it in python)

  • artemishe13 Avatar

    Моя версия программы дает больше вариантов чем тесты, и поэтому немогу пройти полнкю проверку, вот пример тестов Expected: ["121", "122", "124", "131", "132", "134", "161", "162", "164", "221", "222", "224", "231", "232", "234", "261", "262", "264", "421", "422", "424", "431", "432", "434", "461", "462", "464"], instead got: ["112", "113", "116", "121", "122", "123", "124", "126", "131", "132", "134", "142", "143", "146", "161", "162", "164", "212", "213", "216", "221", "222", "223", "224", "226", "231", "232", "234", "242", "243", "246", "261", "262", "264", "412", "413", "416", "421", "422", "423", "424", "426", "431", "432", "434", "442", "443", "446", "461", "462", "464"]

    или ========= Expected: ["101", "102", "104", "181", "182", "184", "201", "202", "204", "281", "282", "284", "401", "402", "404", "481", "482", "484"], instead got: ["101", "102", "104", "110", "118", "120", "128", "140", "148", "181", "182", "184", "201", "202", "204", "210", "218", "220", "228", "240", "248", "281", "282", "284", "401", "402", "404", "410", "418", "420", "428", "440", "448", "481", "482", "484"]

  • thenewwhitefly Avatar

    This one was a time consuming kata.

  • thenewwhitefly Avatar

    I'm confused. Why in the second case 11 is one of the valid numbers but 333 isn't a valid number on the third?

  • dmitryspain98 Avatar

    it took me around 5-6 hours to complete this kata. i've realized how much i need to improve... but very satisfied

  • Krispy_Butter Avatar

    I'm confused on how you get the final answer. Given [5,7,8,9,0] from one of the example tests, how do you get 8? There's certainly more than 8 possible permutations.

    If these are the mappings based on digits adjacent neighbors:

    1: ['1', '2', '4'],

    2: ['1', '2', '5', '3'],

    3: ['2', '3', '6'],

    4: ['1', '4', '5', '7'],

    5: ['2', '4', '5', '8', '6'],

    6: ['3', '5', '6', '9'],

    7: ['4', '7', '8'],

    8: ['5', '7', '8', '0', '9'],

    9: ['6', '8', '9'],

    0: ['0', '8']

    Then you could have the possible permutations:

    1.) [5, 4, 8, 9, 0]

    2.) [5, 4, 8, 9, 8]

    3.) [5, 4, 8, 6, 0]

    4.) [5, 4, 8, 6, 8]

    5.) [5, 4, 8, 8, 0]

    6.) [5, 4, 8, 8, 8]

    7.) [5, 4, 5, 9, 0]

    8.) [5, 4, 5, 9, 8]

    9.) [5, 4, 5, 6, 0]

    10.) [5, 4, 5, 6, 8]

    etc, etc.

    [5, (4,7,8), (8,5,7,0,9), (9,6,8), (0,8)]

    [2, (4,7,8), (8,5,7,0,9), (9,6,8), (0,8)]

    [4, (4,7,8), (8,5,7,0,9), (9,6,8), (0,8)]

    [8, (4,7,8), (8,5,7,0,9), (9,6,8), (0,8)]

    [6, (4,7,8), (8,5,7,0,9), (9,6,8), (0,8)]

    So how does 8 become the final answer?

  • Serafion Avatar

    When i try to run tests it goes crazy and gives me an exception:

    java.lang.UnsupportedOperationException at java.base/java.util.ImmutableCollections.uoe(ImmutableCollections.java:142) at java.base/java.util.ImmutableCollections$AbstractImmutableList.sort(ImmutableCollections.java:261) at TestObservedPin.test(TestObservedPin.java:36) at TestObservedPin.testPins(TestObservedPin.java:31) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42) at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80) at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.codewars.junit5.TestRunner.executeTests(TestRunner.java:64) at com.codewars.junit5.TestRunner.lambda$execute$0(TestRunner.java:56) at com.codewars.junit5.TestRunner.callWithCustomClassLoader(TestRunner.java:147) at com.codewars.junit5.TestRunner.execute(TestRunner.java:56) at com.codewars.junit5.TestRunner.main(TestRunner.java:44)

  • Bop4yH Avatar

    I did it using the construction of a bijection between five-digit numbers and codes, it turned out that everything could be done much easier)

  • givespam Avatar

    in the C version, the free_pins() function doesnt receive the size of the array how can i release every single string inside if i dont know the array len?

  • twsomt Avatar

    I decided, but I made a crutch. I look at the decisions of others and somehow it became uncomfortable) nice kata

  • ReeceGibbs98 Avatar

    Tough Kata. Managed to get it working using itertools quite quickly, but took a bit of mental gymnastics to figure out the list permutations using first principles. Finally got it done. Not the prettiest, but think it worked quite nicely.

  • macklellan Avatar

    Much harder than expected.... Tried writing my own permutation function and failed miserably. Ended up using itertools library. Still lots to learn.

  • Gavric Avatar

    This comment has been hidden.

  • RedWine Avatar

    Nice Kata. For me, it was logical to try it with recursion, and, in the end, it worked. Then i decided to check out the other solutions and, well, i just realized how much i still have to learn. 

  • Gulian510 Avatar

    Hi. I wrote a function that returns array of all variations of pin. But i don't understand what is in the task that should have 1-8 digits when pin has 4 digits?

  • sid114 Avatar
  • CodeSquidwars Avatar

    Traceback (most recent call last): File "tests.py", line 18, in test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'Come on, detective! You can do it better! These are not the PIN variations for "' + tup[0] + '"') TypeError: 'NoneType' object is not iterable

    Its also giving me this error for no reason. Can someone please help me?

  • dashaanan Avatar

    Hello, I've been running my code in Python for a few times and passing all the tests, both sample and random. But every time I "attempt", I get the following stderr code 1 message:

    Traceback (most recent call last): File "/workspace/default/tests.py", line 18, in test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'Come on, detective! You can do it better! These are not the PIN variations for "' + tup[0] + '"') TypeError: 'NoneType' object is not iterable

    It'd be a great help if someone could help or even hint at where i'm lacking

  • Sergey Kovalev Avatar

    Good kata!!!

  • akar-0 Avatar

    (both including random tests)

  • Gabriel425 Avatar

    This comment has been hidden.

  • 7MinutesDead Avatar

    This comment has been hidden.

  • IsaacDreier Avatar

    My code (in C) keeps failing on attempts. It works everytime in the sample tests and for the exact same case. ("8") "0th PIN was expected to be '0', but was 's assertion were not met.'" I printed out the first element and it is '0' like it was asking for. When I print the whole list, the output shows up in the test results instead of the log box.

  • suchencjusz Avatar

    Why can not 233 be the first case instead of 236?? I figthing in python >:c

  • spyhere Avatar

    The flavour of prerequisites and description is outstanding :)

  • Lucasss Avatar

    Ah, the Cartesian product!

  • akar-0 Avatar

    COBOL translation, including random tests (author is inactive).

  • heresy0-0y Avatar

    can't use flatMap in js cus most recent node v. i can use on this kata is 8 </3

  • leaoaugusto Avatar

    This comment has been hidden.

  • Enum0x539 Avatar

    I've solved it (in C#) and compared my results with the cases and everything worked and was correct, When I'm testing here I'm getting the error in the first case which makes me unable to continue (the problem is not in the code, you probably wonder how I so sure? well I tried returning the exact list from the case answer and it was the same error ... and I checked that the number is 8 by throwing exception with the pin) the error ->

    System.IndexOutOfRangeException : Index was outside the bounds of the array. at System.String.get_Chars(Int32 index) at Kata.GetPINs(String observed) at Tests.TestAll()

  • lilsweetcaligula Avatar

    Ah, this kata is one of the early Codewars gems. Although had the kata been created now - it would probably be a 6kyu.

  • Z1pakk Avatar

    Good kata. It took for me about 1.5 hours.

  • maratkhambelov Avatar

    it took me around 5-6 hours to complete this kata. i've realized how much i need to improve... but very satisfied

  • skr_gav Avatar

    This comment has been hidden.

  • MyImaginaryFriend Avatar

    I enjoyed solving this

  • BrandonIW Avatar

    This one is giving me some odd issues on Python 3.9. When I copy/paste my code into the kata, I can only pass the first test and the rest are returning, for example:

    PIN: 11: ['0', '11', '12', '14', '21', '22', '24', '41', '42', '44', '5', '7', '8', '9'] should equal ['11', '12', '14', '21', '22', '24', '41', '42', '44']

    However, when i run the exact same code in pycharm on my system, I get exactly ['11', '12', '14', '21', '22', '24', '41', '42', '44']. There is no '5','7','8','9','0' that is being outputted by my code. And then for the '369' test it tells me that my code is outputting the results from '11' and '8' as well as the results for '369.' Each one it tests, it's telling me that my code is outputting the previous test's results, on top of the current test results...? It's really weird. But on my system, it's working as expected...

  • billgewrgoulas Avatar

    took me a little bit..After trying some complicated solutions with recursions i finally figured it out. It was much easier than it seemed. Anyways, really amazing kata and im glad i could solve it :) .

  • bopre Avatar

    This comment has been hidden.

  • JSPadre Avatar

    I'm very satisfied of this kata 😁 I got new lvl of Impostor Syndrome. And now I'm sure, that I was confused with macaque in the maternity hospital. 7 hours to solve this kata. But thanks anyway 😉

  • 4711 Avatar

    ./src/main/java/ObservedPin.java:45: error: incompatible types: String[] cannot be converted to List return stringArray; ^ Note: ./src/main/java/ObservedPin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error

    i got this error for java 11. any ideas?

  • 4711 Avatar

    This comment has been hidden.

  • el-f Avatar

    Kotlin Translation Please review and approve :)

  • StupiddCoder Avatar

    PIN: 369: ['235', '236', '238', '239', '256', '258', '259', '263', '265', '266', '268', '269', '296', '298', '299', '323', '325', '326', '328', '329', '335', '336', '338', '339', '356', '358', '359', '363', '365', '366', '368', '369', '396', '398', '399', '568', '596', '598', '599', '635', '636', '638', '639', '656', '658', '659', '663', '665', '666', '668', '669', '696', '698', '699', '968', '996', '998'] should equal ['236', '238', '239', '256', '258', '259', '266', '268', '269', '296', '298', '299', '336', '338', '339', '356', '358', '359', '366', '368', '369', '396', '398', '399', '636', '638', '639', '656', '658', '659', '666', '668', '669', '696', '698', '699'] why isn't 235 a variation?/

  • fenreys Avatar

    This comment has been hidden.

  • vladrz Avatar

    Failed asserting that false is true. don't know what does it mean solving by PHP passed all testFixed, passed 4-digits PIN, but if len of PIN > 4 printing me "Failed asserting that false is true."

  • ansis m Avatar

    This comment has been hidden.

  • erythana Avatar

    After comparing my solution with the solution of other people i feel utterly stupid :E

  • ejini战神 Avatar
    • Node 12 should be enabled (Refer this and this for more info)

    • Python new test framework should be used (Refer this & this for more detail)

    • Ruby 3.0 should be enabled (Refer this & this for more detail)

  • wszuc Avatar

    That was hardcore one!

  • apspoliveira Avatar

    Dears,

    Please let me know what is the input for each of the tests. For the first one is clear and is displayed on the screen as the layout and for the others? For instance, I would like to know the input for the observed case "11".

    Cheers, António Pedro

  • cschipg Avatar

    For those stuck, try brushing up on nested reducers and / or using recursion.

  • KimballCotejo Avatar

    This comment has been hidden.

  • Wojtic Avatar

    Very good kata. Thanks!

  • chustos96 Avatar

    very cool kata!! so happy i could solve it

  • Sailor Stat Avatar

    This comment has been hidden.

  • asparius Avatar

    test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'Come on, detective! You can do it better! These are not the PIN variations for "' + tup[0] + '"') File "/home/codewarrior/solution.py", line 32, in get_pins prev_var = get_pins(pin.replace(list_of_pin[len(list_of_pin)-1],"")) File "/home/codewarrior/solution.py", line 32, in get_pins prev_var = get_pins(pin.replace(list_of_pin[len(list_of_pin)-1],"")) IndexError: list index out of range

    I am getting this error. I could not understand why this "a[len(a)-1]" gives error although it passed all tests. Is there anyone to clarify?

  • vst377 Avatar

    This comment has been hidden.

  • themwq Avatar

    This comment has been hidden.

  • SemanticSpy16 Avatar

    This comment has been hidden.

  • PontiusPilate Avatar

    how to fix this bug(tests/Fixture.cs(41,29): error CS1501: No overload for method 'Sort' takes 0 arguments)in C#

  • shisui17 Avatar

    Good kata. Thanks)

  • ehzro3 Avatar

    This comment has been hidden.

  • Naminal Avatar

    All of the tests pass but I still get the following error:

    Traceback (most recent call last): File "main.py", line 18, in test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'Come on, detective! You can do it better! These are not the PIN variations for "' + tup[0] + '"') File "/home/codewarrior/solution.py", line 20, in get_pins out.append(adj_keys[int(x)]) KeyError: 9

  • sumanth729 Avatar

    Why there is no 963 in 3rd test case

  • Tigerhub779 Avatar

    This comment has been hidden.

  • hodgesb Avatar

    This comment has been hidden.

  • -ifrit- Avatar

    One of the preliminary test cases for Haskell has an error. It's the third one, "369". The problems seems to be that the variable k isn't defined. I'm assuming k should have been bound to an array with the combinations for "369", but currently is not defined. The definitive test cases work fine though.

  • Karoluso Avatar

    This comment has been hidden.

  • a5zima Avatar

    This comment has been hidden.

  • nerdess Avatar

    This comment has been hidden.

  • jamiepaugh Avatar

    TypeError: Cannot read property 'sort' of undefined at /home/codewarrior/index.js:35:36 at /runner/frameworks/javascript/cw-2.js:152:11 at Promise._execute at Promise._resolveFromExecutor at new Promise at describe at /home/codewarrior/index.js:27:5 at /home/codewarrior/index.js:38:5 at Object.handleError

    Trying to solve in JS, some tests return okay but others do not.

  • peerlessCoder Avatar

    Just fire that colleague for not doing his job properly

  • julian1234 Avatar

    I don't think you can write a C-solution that does not produce warnings. My program passes the tests but I do not know how to return my results as a const pointer, and I don't see how free_pins could be implemented without discarding the const of its parameter (stdlib free() takes a non-const pointer). Is the Kata just bad for C or is there something I miss?

    otherwise cool kata though.

  • Opabinia Avatar

    This is a great example of a kata which isn't very hard to do in Haskell!

  • anovacap Avatar

    This comment has been hidden.

  • wlaskovic Avatar

    This comment has been hidden.

  • rge123 Avatar

    Easy once you know how; which I didn't for a long time...

  • iwtga Avatar

    I guess it'll be fun:) Detective Mode - ON! Where's my magnifying glass, Watson?

  • Arganancer Avatar

    Pretty fun little challenge! Maybe the challenge rating is language dependent, but I completed it in C# and it felt more on par with level 5 Katas I've previously completed.

  • Gomy Avatar

    This comment has been hidden.

  • jcraffaello Avatar

    Hi all I passed 10 tests but failed in random test with unexpected signal 6, any hint on the random test?

  • BPS Nomad Avatar

    This comment has been hidden.

  • NickDiPreta Avatar

    This comment has been hidden.

  • Med Hedi Bra Avatar

    why he tell me " Cannot read property 'sort' of undefined" despite i didn"t use it??

  • rathesh77 Avatar

    Very good Kata !

  • m3t4Lm4n Avatar

    This comment has been hidden.

  • MatthewSkingley Avatar

    This comment has been hidden.

  • nesteiner Avatar

    This comment has been hidden.

  • ImHatty Avatar

    This comment has been hidden.

  • lonkaan Avatar

    This comment has been hidden.

  • 743627PDSB Avatar

    Sort error

  • lukeyates1981 Avatar

    When solving in PHP, there are issues with the final tests when a single digit pin is provided, despite passing sample tests and all other tests.

    Managed to pass by trying over and over until the random tests did not include a single digit pin!

  • congshuoweihai Avatar

    This comment has been hidden.

  • jjauer Avatar

    The only way I was able to conceptualize this problem was to create a site tree then iterate through it. Is there a better way of looking at this problem that is easy-ish to understand? The short .reduce() solutions are very confusing to me.

  • andrey-n-k Avatar

    Amazing Kata!

  • jenkizenki Avatar

    Is it just me, or do the instructions say "not diagonally", yet the 2nd test expects a diagonal match? Am I missing something?

  • 00dev Avatar

    This comment has been hidden.

  • shanik1986 Avatar

    I'm getting this error on the test - is it my code? It's weird since it past everything and the test doesn't point to what exactly failed

    Traceback (most recent call last): File "main.py", line 18, in test.assert_equals(sorted(get_pins(tup[0])), sorted(tup[1]), 'Come on, detective! You can do it better! These are not the PIN variations for "' + tup[0] + '"') TypeError: 'NoneType' object is not iterable

  • phnxfaze Avatar

    Fun Kata, seems easy using higher order functions. 😀

  • FArekkusu Avatar

    It must allocate all required meomry

    Spelling mistake in C initial solution.

  • hobovsky Avatar

    C translation - please review and let me know if it needs any improvements, especially some description or additional comments about memory management.

  • ChaseGould Avatar

    This comment has been hidden.

  • hobovsky Avatar

    This comment has been hidden.

  • hobovsky Avatar

    I published a fork with random tests rebalanced and unified with other languages (namely C++, because it has the most complete random tests suite compared to others): PIN length is 5 characters, 200 random PINs tested.

    Current C# translation has a problem with the fact that, for some reason, Mono runtime is approx. 3 times slower than 7.3 runtime, and test suite sometimes times out when Mono is selected, but almost always passes when C# 7.3 is selected.

    Please review and approve.

  • sirrus Avatar

    This comment has been hidden.

  • yellowBunny Avatar

    This comment has been hidden.

  • ElectroYan Avatar

    This comment has been hidden.

  • dinglemouse Avatar

    Java List implies order, but result order is not specified/required for this Kata so IMO method should be returning a Set

  • Drift Avatar

    This comment has been hidden.

  • AndreyTiko Avatar

    How to return the button for testing kats?

  • AndreyTiko Avatar

    Kata is super and legend both in meaning and in legend.

  • AndreyTiko Avatar

    Нow to unlock test validation. Of the buttons only there is a "discussion"?

  • jalovatt Avatar

    This comment has been hidden.

  • rt-hawk Avatar

    Thanks for this Kata. The keyboard made it very interesting.

  • FArekkusu Avatar

    C++ translation. Please, review and approve.

  • iamnzrv Avatar

    PIN: 8 - Expected: '['0', '5', '7', '8', '9']', instead got: '[0, 5, 7, 8, 9]'

    Can anyone explain what's an issue? It's working for 2 and 3 characters but fails for 1.

  • willybob7 Avatar

    This comment has been hidden.

  • hobovsky Avatar

    C# translation - please review.

  • Torkel Avatar

    Clojure translation

    Please review and approve.

    I added some short random tests, which probably should be added to other languages as well.

  • cleiver Avatar

    This comment has been hidden.

  • MyNameIsSpencer Avatar

    This comment has been hidden.

  • bestwebua Avatar

    Awesome kata, thanks @BattleRattle!!!

  • _mer_ Avatar

    Very nice idea ! Liked it so much that i had to do a Java-translation (please comment and/or approve).

  • inkplay_ Avatar

    This is confusing for me can some one explain to me where the second and third test case come from? Did we just increase the key pad size?

  • ayubov Avatar

    This was really interesting! Thanks.

  • mjm2050 Avatar

    This comment has been hidden.

  • ajityadav83 Avatar

    getting server execution error for my code for observed pin problem... code runs fine for sample tests ... when i try it using "ATTEMPT" button it gives server executione rror... please help

  • ajityadav83 Avatar

    This comment has been hidden.

  • carkat Avatar

    cannot read property sort of undefined javascript.

    i have entered no code and the test cases are failing. I put in a condition in the test for loop if(getPINs(pin)) then run the test, still doesn't work

  • kodejuice Avatar

    This comment has been hidden.

  • JorgeVS Avatar

    This was good fun. I saw some functions I did not know about in the Haskell solutions. Thx BR.

  • glynester Avatar

    Brilliant. Loved this!

  • CodeyNovice Avatar

    Would someone please explain the following error: "Failed to process output. It is possible that too much data was written to STDOUT."

    I have removed all console.log statements. I am using a cache to improve performance. If the cache gets too large, could that cause this error?

  • OFFLlNE Avatar

    Getting this error on tests.... Because of that I could not work with my code to see what changes do I have to make... TypeError: getPINs(...).sort is not a function at /runner/frameworks/javascript/cw-2.js:179:21 at Promise._execute at Promise._resolveFromExecutor at new Promise at describe at Object.handleError at ContextifyScript.Script.runInThisContext at Object.exports.runInThisContext

  • rtg Avatar

    This comment has been hidden.

  • ekailia Avatar

    Interesting Kaka. Thank you @BattleRattle!

  • adityadixit4476 Avatar

    I have been getting the following message for the last 1 hr whenever I try to submit my code:- Request Timeout: The server timed out running the request. This may be due to an issue with the backend server. Please try again. The test cases all work nicely. ??????

  • haugk Avatar

    Haskell

    I have enjoyed this kata, but it's never a 4kyu, maybe 6 or 7.

  • FkToohey Avatar

    How long do people think this kata should take for an intermediate Python programmer (loose phrase, I know)?
    I am still a beginner and it took me around 2.5 hours. I definitely went off on a bunch of tangents before finding a reasonable solution, though.

  • BIG_Dino_NL Avatar

    Hello, I am new in programming and I don't understand the input. Can someone explain the input?

  • alexanthony813 Avatar

    awesome. really fun

  • franzmoro88 Avatar

    I really enjoyed this kata! Great job!

  • paragonHex Avatar

    Good and exciting kata, just like the most of yours BattleRattle! I think 4 kyu is bit much for it, or am I getting better? :) Thank you!

  • serg-kovalev Avatar

    Nice detective story and kata! Thank you very much!