Memoization is giving me wrong answers. Please can some one help me out here. Without memorization i am getting the right answers as in function targetBestR but