File tree 3 files changed +58
-0
lines changed
solution/0600-0699/0674.Longest Continuous Increasing Subsequence
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,27 @@ function findLengthOfLCIS(nums: number[]): number {
172
172
}
173
173
```
174
174
175
+ ### ** PHP**
176
+
177
+ ``` php
178
+ class Solution {
179
+ /**
180
+ * @param Integer[] $nums
181
+ * @return Integer
182
+ */
183
+ function findLengthOfLCIS($nums) {
184
+ $tmp = $max = 1;
185
+ for ($i = 0; $i < count($nums) - 1; $i++) {
186
+ if ($nums[$i] < $nums[$i + 1]) {
187
+ $tmp++;
188
+ $max = max($max, $tmp);
189
+ } else $tmp = 1;
190
+ }
191
+ return $max;
192
+ }
193
+ }
194
+ ```
195
+
175
196
### ** ...**
176
197
177
198
```
Original file line number Diff line number Diff line change @@ -156,6 +156,27 @@ function findLengthOfLCIS(nums: number[]): number {
156
156
}
157
157
```
158
158
159
+ ### ** PHP**
160
+
161
+ ``` php
162
+ class Solution {
163
+ /**
164
+ * @param Integer[] $nums
165
+ * @return Integer
166
+ */
167
+ function findLengthOfLCIS($nums) {
168
+ $tmp = $max = 1;
169
+ for ($i = 0; $i < count($nums) - 1; $i++) {
170
+ if ($nums[$i] < $nums[$i + 1]) {
171
+ $tmp++;
172
+ $max = max($max, $tmp);
173
+ } else $tmp = 1;
174
+ }
175
+ return $max;
176
+ }
177
+ }
178
+ ```
179
+
159
180
### ** ...**
160
181
161
182
```
Original file line number Diff line number Diff line change
1
+ class Solution {
2
+ /**
3
+ * @param Integer[] $nums
4
+ * @return Integer
5
+ */
6
+ function findLengthOfLCIS ($nums ) {
7
+ $tmp = $max = 1 ;
8
+ for ($i = 0 ; $i < count ($nums ) - 1 ; $i ++ ) {
9
+ if ($nums [$i ] < $nums [$i + 1 ]) {
10
+ $tmp ++ ;
11
+ $max = max ($max , $tmp );
12
+ } else $tmp = 1 ;
13
+ }
14
+ return $max ;
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments