Ad
  • Custom User Avatar

    I had same idea, but checking if sum is correct does not prevent gibberish summing to 45 though.

  • Custom User Avatar

    Looking at my solution at later date i came back to few of my old thoughts and had some new ones.
    At earlier date i kept wondering about:
    std::vector testCase {};
    I wonder how would it affect program if it wasnt declared in each loop and was declared outside loop it is first used. When it is declared in loop it goes out of scope after each repetition and is remade in next iteration. Instead I could have erased its contents with:
    testCase.clear();
    Still i am not sure how it would have affected efficiency of code.

    Next thing I think about now is I could have changed last loop with inner loops (one that uses 4 iterators - k, l, i, j) that checks 3x3 squares and make it bit more readable without changing how it works.