File tree 3 files changed +18
-18
lines changed
solution/2900-2999/2900.Longest Unequal Adjacent Groups Subsequence I
3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,12 @@ public:
130
130
131
131
```go
132
132
func getLongestSubsequence(words []string, groups []int) (ans []string) {
133
- for i, x := range groups {
134
- if i == 0 || x != groups[i - 1] {
135
- ans = append(ans, words[i])
136
- }
137
- }
138
- return
133
+ for i, x := range groups {
134
+ if i == 0 || x != groups[i- 1] {
135
+ ans = append(ans, words[i])
136
+ }
137
+ }
138
+ return
139
139
}
140
140
```
141
141
Original file line number Diff line number Diff line change @@ -154,12 +154,12 @@ public:
154
154
155
155
```go
156
156
func getLongestSubsequence(words []string, groups []int) (ans []string) {
157
- for i, x := range groups {
158
- if i == 0 || x != groups[i - 1] {
159
- ans = append(ans, words[i])
160
- }
161
- }
162
- return
157
+ for i, x := range groups {
158
+ if i == 0 || x != groups[i- 1] {
159
+ ans = append(ans, words[i])
160
+ }
161
+ }
162
+ return
163
163
}
164
164
```
165
165
Original file line number Diff line number Diff line change 1
1
func getLongestSubsequence (words []string , groups []int ) (ans []string ) {
2
- for i , x := range groups {
3
- if i == 0 || x != groups [i - 1 ] {
4
- ans = append (ans , words [i ])
5
- }
6
- }
7
- return
2
+ for i , x := range groups {
3
+ if i == 0 || x != groups [i - 1 ] {
4
+ ans = append (ans , words [i ])
5
+ }
6
+ }
7
+ return
8
8
}
You can’t perform that action at this time.
0 commit comments