Skip to content

Commit bc77796

Browse files
authored
feat: add php solution to lc problem: No.1460 (#1018)
1 parent 3ddf2fe commit bc77796

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

solution/1400-1499/1460.Make Two Arrays Equal by Reversing Subarrays/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,23 @@ impl Solution {
310310
}
311311
```
312312

313+
### **PHP**
314+
315+
```php
316+
class Solution {
317+
/**
318+
* @param Integer[] $target
319+
* @param Integer[] $arr
320+
* @return Boolean
321+
*/
322+
function canBeEqual($target, $arr) {
323+
sort($target);
324+
sort($arr);
325+
return $target === $arr;
326+
}
327+
}
328+
```
329+
313330
### **...**
314331

315332
```

solution/1400-1499/1460.Make Two Arrays Equal by Reversing Subarrays/README_EN.md

+17
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,23 @@ impl Solution {
282282
}
283283
```
284284

285+
### **PHP**
286+
287+
```php
288+
class Solution {
289+
/**
290+
* @param Integer[] $target
291+
* @param Integer[] $arr
292+
* @return Boolean
293+
*/
294+
function canBeEqual($target, $arr) {
295+
sort($target);
296+
sort($arr);
297+
return $target === $arr;
298+
}
299+
}
300+
```
301+
285302
### **...**
286303

287304
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
/**
3+
* @param Integer[] $target
4+
* @param Integer[] $arr
5+
* @return Boolean
6+
*/
7+
function canBeEqual($target, $arr) {
8+
sort($target);
9+
sort($arr);
10+
return $target === $arr;
11+
}
12+
}

0 commit comments

Comments
 (0)