Ad
  • Custom User Avatar

    done

  • Custom User Avatar

    @kdmatrosov: could you have a look at your translation?

  • Custom User Avatar

    Wrong argument types in the initial solution.

  • Custom User Avatar

    No problem!

  • Custom User Avatar

    I'm sorry for using issue, I'll more careful if I meet problem next time. Thanks for help.

  • Custom User Avatar

    No, tests 8 and 9 don't have same data. When you are not sure post a question, not an issue. Moreover almost 1000 guys passed the C++ kata (see at the top of the page); if there was an error somebody would have already seen it, no? Cheers.

  • Custom User Avatar

    I use cpp and test8 and test9 seen have same data, but test need true and test nine need false, I really don't know how to pass test;

  • Custom User Avatar

    What if the vectors are {2, 3} and {9, 4} (should be true)? Or {2, 3, 3} and 4, 9, 9 (should be true)? If I'm not mistaking both cases will fail with your solution.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks, I', really into your katas! I hope that they will allow me to be better at programming, since I'm a total novice. Greetings.

  • Custom User Avatar

    @devtot0 ..

    • Short Code Yet Effective One :+1: :blush:
    • Hope you've Enjoyed this Humble Kata , enjoying Product array , Maximum Multiple , Maximum Product as Well :wink: :relaxed:
    • Happy to follow you Bro :relaxed: .. Hope you all the best on CW .. Regards .. Zizou
  • Custom User Avatar

    So yeah, that's my code. When I run it on cpp.sh with a sample test string (std::string strng = "abcd\nEFGH\nijkl\nMNOP";) and replace k and n with constant numbers (just because these parameters aren't passed to any function), I get exactly the expected output.

    class ScalingSqStrings
    {
    public:
        static std::string scale(const std::string &strng, int k, int n)
        {if(strng == "") return "";
        std::string temp="";
    
       for(int i=0; i<strng.length(); i++)
          {
            
            for(int j=0; j<k; j++)
                
            {
            
            if(strng[i] == '\0' || strng[i] == '\n' ){
                
                for(int l=0; l<n; l++)
                {
                   std::cout << temp << "\n"; 
                }
                temp="";
                break;
                
            }
            temp+=strng[i];
            }
            
            //if(strng[i] == '\n') std::cout << '\n';
            
           }
            for(int l=0; l<n; l++)
                {
                   std::cout << temp << "\n"; 
                }
          }
    };
    
  • Custom User Avatar

    HTH: Try printing the input and see exactly it is.

    But generally we can't help you unless we see your code. Put down your code in a comment in this syntax:

    ```cpp
      ^ language
    this is a code block
       whitespace yay
    ```
    

    If you do this, check 'mark as having spoiler content' below the comment box.

    If next time it's a top-level comment, you can use the label 'question'.

  • Custom User Avatar

    My code displays the correct output in other compilers (for example c++ shell), but somehow I'm not able to get it working here. How can I solve it?