Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -38,10 +38,8 @@ public class LongestAlternatingSubsequence {
/* Compute values in bottom up manner */
for (int i = 1; i < n; i++) {
/* Consider all elements as previous of arr[i]*/
for (int j = 0; j < i; j++) {
/* If arr[i] is greater, then check with las[j][1] */
if (arr[j] < arr[i] && las[i][0] < las[j][1] + 1) {
las[i][0] = las[j][1] + 1;
@ -63,8 +61,12 @@ public class LongestAlternatingSubsequence {
}
public static void main(String[] args) {
int arr[] = {10, 22, 9, 33, 49, 50, 31, 60};
int arr[] = { 10, 22, 9, 33, 49, 50, 31, 60 };
int n = arr.length;
System.out.println("Length of Longest " + "alternating subsequence is " + AlternatingLength(arr, n));
System.out.println(
"Length of Longest " +
"alternating subsequence is " +
AlternatingLength(arr, n)
);
}
}