Sort by

recency

|

148 Discussions

|

  • + 0 comments

    Sherlock is a brilliant detective who uses his sharp intellect and keen observation to solve complex cases. Ekbet12 login

  • + 0 comments

    Sherlock’s approach often involves deducing the correct sequence of events from the numerous possible arrangements, much like finding the right permutation among many possible ones. This can be likened to solving a puzzle where all the elements need to fit together logically. Lion567 Login

  • + 0 comments

    java solution using dynamic programming

        public static int solve(int n, int m) {
            int[][] dpMatrix = new int[n+1][m+1];
            for(int i = 0; i<=n; i++){
                dpMatrix[i][0] = 0;
            }
           for(int i = 0; i<=m; i++){
                dpMatrix[0][i] = 1;
            }
        // Fill the DP table
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= m; j++) {
                    dpMatrix[i][j] = (dpMatrix[i - 1][j] + dpMatrix[i][j - 1]) % MOD;
                }
            }
            return dpMatrix[n][m];
        }
    
  • + 0 comments

    solved as a comb def solve(n, m): return (math.factorial(n+m-1)//(math.factorial(m-1)*math.factorial(n))) % (10**9+7)

  • + 0 comments

    Sherlock Holmes' deductive prowess navigates the intricate permutations of mystery with unparalleled brilliance. Lotus365 com