diff --git a/solutions/030.md b/solutions/030.md index b9881da..4fda099 100644 --- a/solutions/030.md +++ b/solutions/030.md @@ -70,4 +70,25 @@ class Solution: return answer ``` +#### PHP + +```php +class Solution { + + /** + * @param Integer[] $pref + * @return Integer[] + */ + function findArray($pref) { + $n = count($pref); + $y = 0; + for($i = 0; $i < $n; $i++){ + $pref[$i] = $y ^ $pref[$i]; + $y = $y ^ $pref[$i]; + } + + return $pref; + } +} +``` ***NB***: If you want to get community points please suggest solutions in other languages as merge requests.