Move forward by inserting open as well as closed brackets on that index
$ dp [ $ index ] [ $ openbrk ] = find ( $ index + 1 , $ openbrk + 1 , $ n , $ dp , $ adj ) + find ( $ index + 1 , $ openbrk - 1 , $ n , $ dp , $ adj ) ; }