c++ – Grid Dynamic Programming

Problem Statement
There is a grid with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i-th row from the top and the j-th column from the left.For each i and j (1≤i≤H, 1≤j≤W), Square (i,j) is described by a character ai,j. If ai,j is ., Square (i,j) is an empty square; if ai,j is #, Square (i,j) is a wall square. It is guaranteed that Squares (1,1) and (H,W)are empty squares.
Taro will start from Square (1,1) and reach (H,W) by repeatedly moving right or down to an adjacent empty square.
Find the number of Taro’s paths from Square (1,1) to (H,W). As the answer can be extremely large, find the count modulo 109+7.
Source – https://atcoder.jp/contests/dp/tasks/dp_h

In short –
We have H×W grid with each element either ‘.’ or “https://codereview.stackexchange.com/#” where # denote that we cann’t visit this block and ‘.’ denote we can visit it.(1,1) and (H,W) will be always ‘.’ . Find total no. of path from (1,1) to (H,W).

My approach

#include<iostream>
#include<vector>
using namespace std;

const int k=1000000007;

int sol(int i,int j,vector<vector<char>>v,int h,int w,vector<vector<int>>dp){
    if(i>h || j>w){
        return 0;
    }
    if(i==h && j==w){
        return 1;
    }
    if(v(i)(j)=="https://codereview.stackexchange.com/#"){
        return 0;
    }
    if(dp(i)(j)!=-1){
        return dp(i)(j);
    }
    dp(i)(j)=(sol(i+1,j,v,h,w,dp)%k + sol(i,j+1,v,h,w,dp)%k)%k;
    return dp(i)(j);
}

int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<char>>v(h);
    char c;
    vector<vector<int>>dp(h);
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>c;
            v(i).push_back(c);
            dp(i).push_back(-1);
        }
    }
    h--;
    w--;
    cout<<sol(0,0,v,h,w,dp)<<endl;
}

For below test case i am getting TLE

    20 20   
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................
    ....................

How i can improve the time complexity of my approach?