File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,24 @@ function minCount(coins: number[]): number {
116
116
}
117
117
```
118
118
119
+ ### ** PHP**
120
+
121
+ ``` php
122
+ class Solution {
123
+ /**
124
+ * @param Integer[] $coins
125
+ * @return Integer
126
+ */
127
+ function minCount($coins) {
128
+ $cnt = 0;
129
+ for ($i = 0; $i < count($coins); $i++) {
130
+ $cnt += floor($coins[$i] / 2) + ($coins[$i] % 2);
131
+ }
132
+ return $cnt;
133
+ }
134
+ }
135
+ ```
136
+
119
137
### ** ...**
120
138
121
139
```
Original file line number Diff line number Diff line change
1
+ class Solution {
2
+ /**
3
+ * @param Integer[] $coins
4
+ * @return Integer
5
+ */
6
+ function minCount ($coins ) {
7
+ $cnt = 0 ;
8
+ for ($i = 0 ; $i < count ($coins ); $i ++ ) {
9
+ $cnt += floor ($coins [$i ] / 2 ) + ($coins [$i ] % 2 );
10
+ }
11
+ return $cnt ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments