我需要在两个等长字符串之间应用汉明距离。我使用下面的代码
private int HD(String d1, String d2){ return (d1.equals(d2)) ? 0 : 1; }
那么代码编写正确吗?
java
java ×1