Box It!

Sort by

recency

|

455 Discussions

|

  • + 0 comments

    The test is poorly designed, as it doesn't account for its own overflows. Nor does it account for modern C++ features or CLANG features.

  • + 0 comments

    IF YOU SUCCEED AT ALL EXCEPT ONE TEST CASES, READ THIS POST: With one of the test cases, the numbers are so large that even with a line like this (which seems fine)...

    long long CalculateVolume() { return l * b * h; };

    ...The result of this, while converted to a long long eventually, is originally in integer format during multiplication, causing overflow hence producing a negative volume!

    I don't know if there's a more elegant way to do this, but I just decided to do it this way and it worked. long long CalculateVolume() { return (long long) l * (long long) b * (long long) h; };

  • + 0 comments

    What is the input format?? The problem is incomplete

  • + 0 comments

    Here is Box It! problem solution in C++ - https://programmingoneonone.com/hackerrank-box-it-solution-in-cpp.html

  • + 1 comment

    what needs to be called in the main function? There is no definition of it in the problem, thta is causing the test cases to fail.