Preview:
public class Solution {
    public int chordCnt(int n) {
        long mod = 1000000000 + 7;
        long dp[] = new long[n+1];
        dp[0] = 1 ; dp[1] = 1;
        
        for(int k = 2  ; k <= n ; k++){
            
            for(int i = 0 , j = k-1 ; i <= k-1 ; i++ , j--)
            dp[k]= (dp[k]%mod + (((dp[i]%mod)*(dp[j]%mod))%mod))%mod;
        }
        
        return (int)(dp[n] % mod);
    }
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter