Skip to content

Commit fa14a76

Browse files
authored
feat: add php solution to lc problem: No.1323 (doocs#989)
1 parent 1be561b commit fa14a76

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

solution/1300-1399/1323.Maximum 69 Number/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,23 @@ int maximum69Number(int num) {
152152
}
153153
```
154154
155+
### **PHP**
156+
157+
```php
158+
class Solution {
159+
/**
160+
* @param Integer $num
161+
* @return Integer
162+
*/
163+
function maximum69Number($num) {
164+
$num = strval($num);
165+
$n = strpos($num, "6");
166+
$num[$n] = 9;
167+
return intval($num);
168+
}
169+
}
170+
```
171+
155172
### **...**
156173

157174
```

solution/1300-1399/1323.Maximum 69 Number/README_EN.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,23 @@ int maximum69Number(int num) {
139139
}
140140
```
141141
142+
### **PHP**
143+
144+
```php
145+
class Solution {
146+
/**
147+
* @param Integer $num
148+
* @return Integer
149+
*/
150+
function maximum69Number($num) {
151+
$num = strval($num);
152+
$n = strpos($num, "6");
153+
$num[$n] = 9;
154+
return intval($num);
155+
}
156+
}
157+
```
158+
142159
### **...**
143160

144161
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
/**
3+
* @param Integer $num
4+
* @return Integer
5+
*/
6+
function maximum69Number($num) {
7+
$num = strval($num);
8+
$n = strpos($num, "6");
9+
$num[$n] = 9;
10+
return intval($num);
11+
}
12+
}

0 commit comments

Comments
 (0)