水题,原来以为用dp数组 结果wrong了两次 我想还是自己小题大做了···呵呵·· 献给初学者作为参考 #include <stdio.h> #include <string.h> #define MAX 200 int getCommonStrLength(char * pFirstStr, char * pSecondStr) { int m = strlen(pFirstStr); int n = strlen(pSecondStr); int max = 0; int…
694. Distinct Substrings Problem code: DISUBSTR Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one string, whose length is <= 1000 Output For each test c…