You are not logged in. Please login at to post your questions!


Why is this code giving me TLE?

Solution. I know why a TLE occurs but I think my code is quite efficient over here as I have memoized it!

asked 11 Apr '15, 14:32

psych_cod3r's gravatar image

accept rate: 0%

Well no one answered it.. Just in case anyone needs it-> The reason was I was setting up my dp table as 0 and the possibility that the answer will be zero is high.... Hence it recomputed even if the answer was computed once.... So preset the dp table with a better value :)


answered 12 Apr '15, 19:21

psych_cod3r's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 11 Apr '15, 14:32

question was seen: 682 times

last updated: 12 Apr '15, 19:21