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
    
  
  
    
  | 1 80,982 163,8164 170,2620 145,648 200,8021 173,2069 92,647 26,4122 140,546 11,1913 160,6461 27,7905 40,9047 150,2183 61,9146 159,7420 198,1724 114,508 104,6647 30,4612 99,2367 138,7896 169,8700 49,2437 125,2909 117,2597 55,6399 | |
| 2 42,1689 127,9365 5,8026 170,9342 131,7005 172,1438 34,315 30,2455 26,2328 6,8847 11,1873 17,5409 157,8643 159,1397 142,7731 182,7908 93,8177 | |
| 3 57,1239 101,3381 43,7313 41,7212 91,2483 31,3031 167,3877 106,6521 76,7729 122,9640 144,285 44,2165 6,9006 177,7097 119,7711 | |
| 4 162,3924 70,5285 195,2490 72,6508 126,2625 121,7639 31,399 118,3626 90,9446 127,6808 135,7582 159,6133 106,4769 52,9267 190,7536 78,8058 75,7044 116,6771 49,619 107,4383 89,6363 54,313 | |
| 5 200,4009 112,1522 25,3496 23,9432 64,7836 56,8262 120,1862 2,8026 90,8919 142,1195 81,2469 182,8806 17,2514 83,8407 146,5308 147,1087 51,22 | |
| 6 141,8200 98,5594 66,6627 159,9500 143,3110 129,8525 118,8547 88,2039 83,4949 165,6473 162,6897 184,8021 123,13 176,3512 195,2233 42,7265 47,274 132,1514 2,8847 171,3722 3,9006 | |
| 7 156,7027 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
    
  
  
    
  | class PermutateWords: | |
| def permutate(self, input): | |
| self.result = [] | |
| self.find_permutation(input, 0, []) | |
| return self.result | |
| def find_permutation(self, input, next_word_pos, found): | |
| if len(found) == len(input) or next_word_pos >= len(input): | |
| if len(found) == len(input): | |
| self.result.append("".join(found)) | 
  
    
      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
    
  
  
    
  | class PatternNode: | |
| def __init__(self, char, count, repeat): | |
| self.value = char | |
| self.count = count | |
| self.repeat = repeat | |
| class WordNode: | |
| def __init__(self, value, count): | |
| self.value = value | 
  
    
      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
    
  
  
    
  | class PhpParser: | |
| def parse(self, tokens): | |
| self.left_bracket = 0 | |
| self.is_class = False | |
| self.function = False | |
| self.double_quote = False | |
| self.single_quote = False | |
| class_map = {} | |
| current_class = None | 
  
    
      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
    
  
  
    
  | def find_min_steps(M, N): | |
| m = M | |
| n = N | |
| count = 0 | |
| while m >=1 and n>=1: | |
| if m > n: | |
| if m - n >= 1: | |
| count+=1 | |
| m = m - n | |
| 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
    
  
  
    
  | class FindMissingNumber: | |
| def find_missing_number(self, list): | |
| max_len = len(list) - 1 | |
| for i, n in enumerate(list): | |
| if i != n-1 and n - 1 <= max_len: | |
| self.swap(list, i, n-1) | |
| for i, n in enumerate(list): | 
  
    
      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
    
  
  
    
  | class Balance: | |
| def __init__(self, id): | |
| self.id = id | |
| self.left = self.right = None | |
| self.lweight = self.rweight = 0 | |
| self.visited = False | |
| self.base = 10 | |
| def total(self): | 
  
    
      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
    
  
  
    
  | class ArbitraryIO: | |
| def __init__(self, data): | |
| self.last_read_pos = 0 | |
| self.read_pos =0 | |
| self.tmp_buf = "" | |
| self.data = data | |
| def read4(self): | |
| self.tmp_buf = data[self.read_pos: self.read_pos+4] | |
| self.read_pos += len(self.tmp_buf) | 
  
    
      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
    
  
  
    
  | class Room: | |
| def __init__(self, capacity, target): | |
| self.cap = capacity | |
| self.target = target | |
| self.count = 0 | |
| self.target_count = int(self.cap * self.target) | |
| def occupancy(self): | |
| return self.count *1.0 / self.cap | 
  
    
      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
    
  
  
    
  | class GuessWord: | |
| def __init__(self): | |
| self.alphabet = 'abcdefghijklmnopqrstuvwxyz' | |
| def guess(self, target): | |
| self.target = target | |
| found = self.find_target_length() | |
| length = found[0] | |
| target_chars = found[1] | 
NewerOlder