Ad
  • Custom User Avatar

    I'm confused about what our function is supposed to return -- phone numbers that are valid or the regex pattern used to match them?

  • Custom User Avatar

    Thank you, that's extremely helpful.

  • Custom User Avatar

    if you create a file structure like this on your pc:

    /
    └── important
       └── confidential
          └── docs
             └── index.html
    

    then the path to confidential is /important/confidential

    there's no /confidential, that would look like this:

    /
    ├── confidential
    └── important
       └── confidential
          └── docs
             └── index.html
    

    but now you have two different confidential, and you would be referring to the wrong one, unless of course /confidential links to /important/confidential which it very well could, but you know nothing about that and shouldn't assume it does.

    /
    ├── confidential -> important/confidential
    └── important
       └── confidential
          └── docs
             └── index.html
    

    it's the same with index.html and docs, they too are not directly under /

  • Custom User Avatar

    First of all, thank you for the sound advice to a newbie like me. I made note of both points. I am working on the Breadcrumbs Generator kata, in which we write code (in Python in my case) to made URLs into Breadcrumbs. So, for example, we take a URL like: microsoft.com/resources/help/support and change it into HOME * RESOURCES * HELP * SUPPORT. The problem is that one of the four initial test cases takes "www.microsoft.com/important/confidential/docs/index.htm#top", which from my understanding of the assignment, should turn into HOME * IMPORTANT * CONFIDENTIAL * DOCS. For each hunk the underlying anchor should be to the appropriate section. And yet the approved answer has two of the sections combined in one anchor, which seems like it shouldn't be. This is the test case in question: compare_bc(generate_bc("www.microsoft.com/important/confidential/docs/index.htm#top", " * "), '<a href="/">HOME</a> * <a href="/important/">IMPORTANT</a> * <a href="/important/confidential/">CONFIDENTIAL</a> * <span class="active">DOCS</span>') Notice that CONFIDENTIAL has "/important/confidential" in its anchor, instead of just "/confidential" My solution is failing only on this one test, and I don't see how, following the rules of the challenge, I could pass it. So that's my question or problem. Is it the test that messed up, or am I missing something?

  • Custom User Avatar

    first of all, please use the tag question when you are asking something.

    use markdown to mark code as code so that it does not get interpreted as formatting:

    ```html
    <a href="/">HOME</a> > <a href="/very-long-url-to-make-a-silly-yet-meaningful-example/">VLUMSYME</a> > <span class="active">EXAMPLE</span>
    ```

    as for the question:

    that is the location of confidential. it's not directly under /

    https://www.codewars.com/kata/563fbac924106b8bf7000046/discuss/python
    https://www.codewars.com/kata/563fbac924106b8bf7000046/discuss/
    https://www.codewars.com/kata/563fbac924106b8bf7000046/
    https://www.codewars.com/kata/
    https://www.codewars.com/
    

    discuss here doesn't sit under /:

    https://www.codewars.com/discuss/
    

    because then which kata are you discussing?

  • Custom User Avatar

    Is this me or Code Wars? Here's the original URL and separator:
    "www.microsoft.com/important/confidential/docs/index.htm#top", " * "
    This is what I delivered:
    'HOME * IMPORTANT * CONFIDENTIAL * DOCS'
    This is what I'm being told I SHOULD have delivered:
    'HOME * IMPORTANT * CONFIDENTIAL * DOCS'
    Why would we want groups 2 and 3 smushed together under the link for group 3? That makes no sense to me, and it does seem to accord with the instructions for the exercise. After I posted this I realized that the problematic aspect was turned into links in my post. The links for CONFIDENTIAL in my version is the a-link href for "confidential", whereas is their version it's an a-link href for both "important" and "confiential", with the two run together inside one a-link tag.

  • Custom User Avatar

    Okay, I'm very confused. I thought the idea was that we put a first string into the first (encoding) program, which then produced a second string and a number. And then, if we fed the second string and the number into the second (decoding) program, we would end up getting the first string back again. This would seem to be a self-testing pair of programs. If A produces B, but then B gives us C, it's not working correctly. So I run the first few tests, and all go well. Then I run the humongous set of tests, and I'm told that in between two and four cases, I'm getting the "wrong" result out of the encoding program. But if I feed what they provide into my encoding program and them put it back through to be decoded, it all seems to work. I haven't a clue as to how to begin to troubleshoot these few "wrong" answers that seem to be right, according to the results I get. I even tried my encoding/decoding programs with a string that was hundreds of characters long, and it still seemed to work. Ideas? Suggestions?