This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MagedAhmad\LaraPayment; | |
use GuzzleHttp\Client; | |
use MagedAhmad\LaraPayment\Paymob; | |
use MagedAhmad\LaraPayment\Models\Balance_summary; | |
class LaraPayment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MagedAhmad\LaraPayment; | |
use GuzzleHttp\Client; | |
use MagedAhmad\LaraPayment\Paymob; | |
use MagedAhmad\LaraPayment\Models\Balance_summary; | |
class LaraPayment | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function minimumSwaps($arr) { | |
$swaps = 0; | |
for($i = 0; $i < count($arr); $i++) { | |
while($arr[$i] != $i + 1) { | |
$temp = $arr[$i]; | |
$arr[$i] = $arr[$temp-1]; | |
$arr[$temp-1] = $temp; | |
$swaps++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function minimumBribes($q) { | |
$count = 0; | |
for($i = count($q) -1 ; $i >= 0; $i--) { | |
if($q[$i] - ($i+1) > 2) { | |
print "Too chaotic" . "\n"; | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rotLeft($a, $d) { | |
$temp = []; | |
for($i = 0; $i < $d; $i++) { | |
$temp[$i] = $a[$i]; | |
} | |
$a = array_slice($a, $d); | |
$result = array_merge($a, $temp); | |
return $result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hourglassSum($arr) { | |
for($i = 0; $i < count($arr) - 2; $i++) { | |
for($j = 0; $j < count($arr[$i]) - 2; $j++) { | |
$results[] = $arr[$i][$j] + $arr[$i][$j+1] + $arr[$i][$j+2] | |
+ $arr[$i+1][$j+1] | |
+ $arr[$i+2][$j] + $arr[$i+2][$j+1] + $arr[$i+2][$j+2]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Complete the repeatedString function below. | |
function repeatedString($s, $n) { | |
$i = 0; | |
$count = 0; | |
while($i < strlen($s)){ | |
if ($s[$i] == 'a') { | |
$count++; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 0 0 0 0 1 0 | |
function jumpingOnClouds($c) { | |
$start = 0; | |
$counts = 0; | |
while($start < count($c) - 1) { | |
if( ($start + 2) < count($c) && $c[$start + 2] != 1) { | |
$counts++; | |
$start = $start + 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function countingValleys($n, $s) { | |
$count = 0; | |
$track = 0; | |
for($i = 0; $i < $n; $i++) { | |
if($s[$i] == 'U') { | |
$track++; | |
}else { | |
if($track == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC] | |
RewriteRule ^ %1 [L,NE,R=302] | |
RewriteRule ^((?!public/).*)$ public/$1 [L,NC] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /index.php?/$1 [L] |