Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Solution.java
  • Loading branch information
ThanhNIT committed Mar 19, 2022
commit da178743baed2f80946ece9021275094200512e4
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public int minimumDistance(String word) {
}

private int find(Character f1, Character f2, int index) {
if (index == word.length()) return 0;
if (index == word.length()) {
return 0;
}

Integer result = dp[f1 == null ? 0 : f1 - 'A' + 1][f2 == null ? 0 : f2 - 'A' + 1][index];
if (result != null) {
Expand All @@ -31,7 +33,9 @@ private int find(Character f1, Character f2, int index) {
}

private int move(Character c1, Character c2) {
if (c1 == null) return 0;
if (c1 == null) {
return 0;
}

int c1x = (c1 - 'A') % 6;
int c1y = (c1 - 'A') / 6;
Expand Down