7 kyu

Complete The Pattern #2

2,310 of 7,409DivyanshBatham
Description
Loading description...
ASCII Art
Puzzles
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar

    Java:

    • Actual and expected of random tests are swapped

    • Should use assertion messages instead of logging

    • Reference solution should be private

  • saudiGuy Avatar
  • Infuzibil Avatar

    Excelent kata, many concepts in just a few lines.

  • Scatterblak Avatar

    This comment has been hidden.

  • user4896126 Avatar

    me no like kata this

  • bennyBoy_ Avatar

    Dear Curious_db97 Thank you for this Kata. Although I'm a new coder and do not have a strong base for comparison, I found this very challenging! At first I was pulling my hair out trying to figure out how to detect the object ends with 0 or not, and how to remove a single item or 2. ex: How did the pattern go from: 543210 to 5432 ??

    Was it your hope to create this type of consideration? Thankfully, an accpetable result was finally discovered! (although I don't have much hair left) Thank you!

  • stellartux Avatar
  • adamgonzo34 Avatar

    I'm unsure why mine is timing out... This is the error I am getting. ( C# )

    STDERR: Process was terminated. It took longer than 12000ms to complete Signal: Process exited prematurely with a SIGKILL signal.


    It shows that I'm passing all the tests?

    Test Results: Tests RandomGeneratedNumbers Test Passed Completed in 0.349773ms SimpleNumbers Test Passed Completed in 0.000266ms

  • lukikow Avatar

    -isystem /runner/frameworks/cpp/ error: 'pattern' is a private member of 'Pattern' Assert::That(Pattern::pattern(4), Equals("4321\n432\n43\n4"));

    (c++) here is a issue or I do something wrong ?

  • krut514 Avatar

    This comment has been hidden.

  • SutoZ Avatar

    This comment has been hidden.

  • wernstrom Avatar

    This comment has been hidden.

  • ooolize Avatar

    This comment has been hidden.

  • aleksandr.senichev Avatar

    I have an strange error: ✘ Expected: 1, instead got: 1. It works in cloud IDE but here i got the error. (javascript)

  • eoinnoble Avatar

    This comment has been hidden.

  • sharifahmad Avatar

    C++ translation kumitted kindly approve it so that c++ geeks can give it a try.

  • PantlessBandit Avatar

    This comment has been hidden.

  • SallyDemch Avatar

    What am I doing wrong? On the first test, I have a failure: 1 None should equal '1'

    or

    Why I can't connet "from future import print_function" ?? File "", line 6 SyntaxError: from future imports must occur at the beginning of the file

  • jamesbond91 Avatar

    I get this error "Submission timed out while communicating with our servers. This may infrequently happen if our servers are extremly busy. Please try again. If issues persist you can check status.codewars.com to see if server issues are being investigated. " on submitting the solution. Why it is like this"

  • teochewthunder Avatar

    I don't get it.

    Expected: 54321 5432 543 54 5, instead got: 54321 5432 543 54 5

    I am returning the output. What's wrong?

  • malilav Avatar

    Hi, i receive the following output for my code - and though it seems to be ok i still get an error in the browser and won't let me pass. My output: C:\Python27\python.exe C:/Users/########/PycharmProjects/TestProject/TestPackage/test222.py 1110987654321 111098765432 11109876543 1110987654 111098765 11109876 1110987 111098 11109 1110 11

    Process finished with exit code 0

    I get a message: "None should equal '1'" Not sure what the problem is. Thank you.

  • TeodorDumitru Avatar

    The actual expected values (when I try to submit) do not respect the requirements. For example:

    Expected: 16151413121110987654321 1615141312111098765432 161514131211109876543 16151413121110987654 1615141312111098765 161514131211109876 16151413121110987 1615141312111098 161514131211109 16151413121110 161514131211 1615141312 16151413 161514 1615 16 instead got: 16151413121110987654321 1615141312111098765432 161514131211109876543 16151413121110987654 1615141312111098765 161514131211109876 16151413121110987 1615141312111098 161514131211109 16151413121110 1615141312111 161514131211 16151413121 1615141312 161514131 16151413 1615141 161514 16151 1615 161 16 1

  • linux0id Avatar

    I don't understand why I get that "slice" doesn't exists, do I need to write my own functions for everything?

  • brandongarcia Avatar

    This comment has been hidden.

  • Azuaron Avatar

    Haskell translation available.

  • NeuralLink Avatar

    The instructions did not clearly indicate that where n is greater than 2 digits in length that you want the 2-digit numbers removed as whole numbers or as individual digits:

    151413121110987654321
    15141312111098765432
    1514131211109876543
    151413121110987654
    15141312111098765
    1514131211109876
    151413121110987
    15141312111098
    1514131211109
    151413121110
    15141312111
    1514131211
    151413121
    15141312
    1514131
    151413
    15141
    1514
    151
    15
    1

    vs.

    151413121110987654321
    15141312111098765432
    1514131211109876543
    151413121110987654
    15141312111098765
    1514131211109876
    151413121110987
    15141312111098
    1514131211109
    151413121110
    1514131211
    15141312
    151413
    1514
    15

    This can be inferred via the "upto n number of rows" part of the instruction but it could be more clear.

    Additionally, I would recommend adding a unit test to cover that scenario.

    Something like this would be nice:

    Assert.AreEqual("1110987654321\n111098765432\n11109876543\n1110987654\n111098765\n11109876\n1110987\n111098\n11109\n1110\n11", k.Pattern(11));

  • kristaps Avatar

    Kata was more complicated than initially thought, but was just alright. Hmm, I am far from implementing Python "one-liners", but I notice I am not generating too much code either + readable.

    How to know if my code is good at all ? Should I strive to learn these Python one-liners ? Because nearly every Python kata solutions section has these, and it worries me that I can't comprehend them.

  • beaugaines Avatar

    This comment has been hidden.

  • mihirk Avatar

    This comment has been hidden.

  • GiacomoSorbi Avatar

    Same as with the other kata, still if you wish to approve my translations :)