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 Feb 26, 2022
commit fa09f7c0154a116c6b4109ed499a89b4723d445f
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public int longestArithSeqLength(int[] nums) {
}

int ans = 0;
for (int i = 0; i < n; i++)
for (int i = 0; i < n; i++) {
for (int j = i - 1; j >= 0; j--) {
int difference = nums[i] - nums[j] + diff;
int temp = dp[j][difference];
Expand All @@ -26,6 +26,7 @@ public int longestArithSeqLength(int[] nums) {
ans = dp[i][difference];
}
}
}

return ans;
}
Expand Down