I am unable to assume the base case.
please help
Base case problem
hi @tusharbhardwaj127 did you figure out the recurrance relation? Once you do that its quite easy to figure out the base case.
yes the recurence relation was f(n-1) +f(n-2)
I considered the base case as
if(n==0 or n==1) return 1
if(n==2) return 3
it didn’t work
hey.
so both 0 and 1 will be considered as a good subarray?
ok, I got it.
Thanks
1 Like