harikrishna-patnala commented on a change in pull request #4553:
URL: https://github.com/apache/cloudstack/pull/4553#discussion_r546596930



##########
File path: utils/src/main/java/com/cloud/utils/StringUtils.java
##########
@@ -313,4 +313,42 @@ public static String mapToString(final Map<String, String> 
map) {
     public static String toCSVList(final List<String> csvList) {
         return join(csvList, ",");
     }
+
+    public static int min(int x, int y, int z)
+    {
+        if (x <= y && x <= z)
+            return x;
+        if (y <= x && y <= z)
+            return y;
+        else
+            return z;
+    }
+
+    /**
+     * Calculates minimum number of edits required to convert from one string 
to another string.
+     * @param str1
+     *      String that needs editing
+     * @param str2
+     *      Target string that needs after editing
+     * @return minimum number of edits required to convert str1 to str2
+     */
+    public static int minimumEditDistance(String str1, String str2) {

Review comment:
       Added unit tests in new commit.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to