# Project Euler #85: Counting rectangles

# Project Euler #85: Counting rectangles

kitchent + 0 comments Once again, a problem setting where an elegant approach becomes dirty because of large number of tests, compromise in memoization and memory management.

Hint: the count of a given rectangle is , where . Generate a list of (the upper bound can be found easily), and then a list of all results, sort them and find the nearest result(s). If it is not for the last 2 test cases, the overall performance would be much more impressive (a few ms vs a few sec).

Alexander125 + 1 comment It is strange, 6 tests are failed, but I got status "Accepted"

kk3799 + 0 comments Same thing happened with me ,i suggest you to handle the case where target is equidistant from two valid no. of rectangles possible .

toka_eldeeb + 0 comments can anyne help me with test cases so i can know where is the fault in my code

tanmaya_26 + 1 comment can we get testcases , atleast a few? some of my test cases are working but some are not. Out of a million possibilities it is hard to figure out the error in code ! help !!

shashank21jHackerRank AdminChallenge Author + 1 comment create a few testcase, write a brute force and check

acham_sanjeev + 0 comments can you share few more test cases, my code executed sucessfully for first test case rest are failed.

marckoch + 0 comments I have been stuck with this for a while. What saved me was thinking about the rectangle 1999 x 1 and how many rectangles it contains ;-)

Sort 9 Discussions, By:

Please Login in order to post a comment