import java.util.LinkedList;
public class Main {
public static void main(String[] args) {
String str = "0100110001010001 ";
LinkedList<String> home = new LinkedList<String>();
for (int i = 1; i < str.length(); i++) {
for (int j = 0; j < str.length()-i; j++) {
String subStr = str.substring(j,j+i);
if(!home.contains(subStr)) {
home.add(subStr);
}
}
}
System.out.println(home.size());
}
}
不同子串
最新推荐文章于 2022-04-03 16:30:30 发布