Skip to content

Commit f51d868

Browse files
authored
feat: add php solution to lc problem: No.0769 (doocs#957)
1 parent 24d191c commit f51d868

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

solution/0700-0799/0796.Rotate String/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ impl Solution {
104104
}
105105
```
106106

107+
### **PHP**
108+
109+
```php
110+
class Solution {
111+
/**
112+
* @param String $s
113+
* @param String $goal
114+
* @return Boolean
115+
*/
116+
function rotateString($s, $goal) {
117+
return strlen($goal) === strlen($s) && strpos(($s.$s), $goal) !== false;
118+
}
119+
}
120+
```
121+
107122
### **...**
108123

109124
```

solution/0700-0799/0796.Rotate String/README_EN.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,21 @@ impl Solution {
8787
}
8888
```
8989

90+
### **PHP**
91+
92+
```php
93+
class Solution {
94+
/**
95+
* @param String $s
96+
* @param String $goal
97+
* @return Boolean
98+
*/
99+
function rotateString($s, $goal) {
100+
return strlen($goal) === strlen($s) && strpos(($s.$s), $goal) !== false;
101+
}
102+
}
103+
```
104+
90105
### **...**
91106

92107
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
/**
3+
* @param String $s
4+
* @param String $goal
5+
* @return Boolean
6+
*/
7+
function rotateString($s, $goal) {
8+
return strlen($goal) === strlen($s) && strpos(($s.$s), $goal) !== false;
9+
}
10+
}

0 commit comments

Comments
 (0)