File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 14
14
longest(a, a) -> "abcdefghijklmnopqrstuvwxyz"
15
15
*/
16
16
17
- function longest ($ a , $ b )
17
+ function longest ($ stringone , $ stringtwo )
18
18
{
19
- $ combinedString = $ a . $ b ;
20
- $ arrayString = str_split ($ combinedString );
21
- $ uniqueString = array_unique ($ arrayString );
19
+ $ combinedString = $ stringone . $ stringtwo ;
20
+ $ stringonerrayString = str_split ($ combinedString );
21
+ $ uniqueString = array_unique ($ stringonerrayString );
22
22
sort ($ uniqueString );
23
23
return implode ($ uniqueString );
24
24
}
25
25
26
26
// Alternate solution
27
27
28
- function altlongest ($ a , $ b )
28
+ function altlongest ($ stringone , $ stringtwo )
29
29
{
30
- $ chars = array_unique (str_split ($ a . $ b ));
30
+ $ chars = array_unique (str_split ($ stringone . $ stringtwo ));
31
31
sort ($ chars );
32
32
return implode ('' , $ chars );
33
33
}
You can’t perform that action at this time.
0 commit comments