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
    
  
  
    
  | #nftset=/.ua/4#inet#fw4#vpn_domains | |
| #nftset=/10minutemail.com/4#inet#fw4#vpn_domains | |
| #nftset=/1337x.to/4#inet#fw4#vpn_domains | |
| #nftset=/24.kg/4#inet#fw4#vpn_domains | |
| #nftset=/4freerussia.org/4#inet#fw4#vpn_domains | |
| #nftset=/4pda.ru/4#inet#fw4#vpn_domains | |
| #nftset=/4pda.to/4#inet#fw4#vpn_domains | |
| #nftset=/7dniv.rv.ua/4#inet#fw4#vpn_domains | |
| #nftset=/9tv.co.il/4#inet#fw4#vpn_domains | |
| #nftset=/a-msedge.net/4#inet#fw4#vpn_domains | 
  
    
      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 bump(array $asteroids) : array { | |
| for ($i=0; $i < count($asteroids)-1; $i++) { | |
| if ($asteroids[$i] > 0 && $asteroids[$i+1] < 0) { | |
| if ($asteroids[$i] > abs($asteroids[$i+1])) { | |
| unset($asteroids[$i+1]); | |
| } else if ($asteroids[$i] < abs($asteroids[$i+1])) { | |
| unset($asteroids[$i]); | |
| } else { | 
  
    
      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 | |
| require 'vendor/autoload.php'; | |
| use MyDataStructure\MyBinarySearchTree; | |
| $tree = new MyBinarySearchTree(); | |
| $tree->add(4); | |
| $tree->add(2); | |
| $tree->add(1); | 
  
    
      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 MyDataStructure; | |
| class MyBinarySearchTree extends MyTree | |
| { | |
| /** | |
| * Добавление узла в дерево | 
  
    
      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 printSections($sections) { | |
| foreach ($sections as $section) { | |
| print str_pad('|',$section[0]+1,' ',STR_PAD_LEFT).str_pad('|',$section[1]-$section[0]+1,'-',STR_PAD_LEFT)." ({$section[0]}-{$section[1]})".PHP_EOL; | |
| } | |
| } | |
| function sortSections($sections) { | |
| for ($i = 0; $i < count($sections); $i++) { | |
| for ($j = 0; $j < count($sections) - 1; $j++) { | 
  
    
      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 majority(array $array): array { | |
| $output = []; | |
| $count = count($array); | |
| sort($array); | |
| $current_element_count = 1; | |
| for ($i = 0; $i < $count; $i++) { | |
| if ($i !== $count-1) { | |
| if ($array[$i] === $array[$i+1]) { | 
  
    
      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
    
  
  
    
  | public static function restoreTree(array $preorder, array $inorder) : self { | |
| $tree = new self(); | |
| $root = $tree->add($preorder[0]); | |
| $tree->splitInorder($root, $preorder, $inorder); | |
| return $tree; | |
| } | 
  
    
      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 compareVersions(string $version1, string $version2) : int { | |
| $parts1 = explode('.', $version1); | |
| $parts2 = explode('.', $version2); | |
| $diff = abs(count($parts1) - count($parts2)); | |
| if (count($parts1) > count($parts2)) { | |
| $parts2 = array_merge($parts2, array_fill($diff-1, $diff, 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
    
  
  
    
  | public function SymmetricOrder() : string { | |
| $output = ""; | |
| $stack = new MyStack(); | |
| $node = $this->root; | |
| while ($node !== null) { | |
| if ($node->getLeft() !== null) { | |
| $stack->push($node); | |
| $node = $node->getLeft(); | |
| } else { | |
| $output .= $node->getData()." "; | 
  
    
      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 | |
| /** | |
| * Разбинение строки | |
| * https://telegra.ph/Anons-238-Razdelenie-stroki-09-10 | |
| * | |
| * На первой итерации берем первый символ и ищем его последнее вхождение в строке | |
| * это будет первый кусок (или по крайней мере его начало) | |
| * Далее для каждого следующего символа остатка строки проверяем есть ли он в предыдущих уже сгенерированных кусках, | |
| * если нет, то формируем новый кусок и по примеру первой итерации ищем его последее вхождение и так до тех пор пока |