【题目】给定一个字符串数组strs,再给定两个字符串str1和str2,返回在strs中str1与str2的最小距离,如果str1或str2为null,或不在strs中,返回-1。
public class MiDistance {
public static int getMinDistance(String[] strs, String str1, String str2) {
if (str1 == null
【题目】给定一个字符串数组strs,再给定两个字符串str1和str2,返回在strs中str1与str2的最小距离,如果str1或str2为null,或不在strs中,返回-1。
public class MiDistance {
public static int getMinDistance(String[] strs, String str1, String str2) {
if (str1 == null