SYMBOL INDEX (2088 symbols across 591 files) FILE: bin/test_python.py function get_unittests (line 17) | def get_unittests(dirname): function get_doctests (line 39) | def get_doctests(dirname): FILE: codewars/delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.js function deleteNth (line 1) | function deleteNth(nums, n) { FILE: codewars/double_cola.js function whoIsNext (line 1) | function whoIsNext(names, r) { FILE: codewars/iq_test.js function iqTest (line 1) | function iqTest(nums) { FILE: codewars/is_a_number_prime.js function isPrime (line 1) | function isPrime(num) { FILE: codewars/multiply.js function multiply (line 1) | function multiply(a, b) { FILE: codewars/rectangle_into_squares.js function sqInRect (line 1) | function sqInRect(lng, wdth) { FILE: codewars/reverse_words.js function reverseWords (line 1) | function reverseWords(s) { FILE: codewars/simple_encryption_1_alternating_split.js function encrypt (line 1) | function encrypt(text, n) { function decrypt (line 23) | function decrypt(text, n) { FILE: codewars/sudoku_solution_validator.js function validSolution (line 1) | function validSolution(board) { FILE: codewars/take_a_ten_minute_walk.js function isValidWalk (line 1) | function isValidWalk(walk) { FILE: codewars/tribonacci_sequence.js function tribonacci (line 1) | function tribonacci(signature, n) { FILE: codewars/unique_in_order.js function uniqueInOrder (line 1) | function uniqueInOrder(iterable) { FILE: codewars/who_likes_it.js function likes (line 1) | function likes(names) { FILE: leetcode/101_symmetric_tree.py class Solution (line 11) | class Solution: method isSymmetric (line 12) | def isSymmetric(self, root): method divide_conquer (line 22) | def divide_conquer(self, left, right): FILE: leetcode/105_construct_binary_tree_from_preorder_and_inorder_traversal.py class Solution (line 9) | class Solution(object): method buildTree (line 10) | def buildTree(self, P, I): FILE: leetcode/108_convert_sorted_array_to_binary_search_tree.py class Solution (line 9) | class Solution: method sortedArrayToBST (line 10) | def sortedArrayToBST(self, nums): FILE: leetcode/112_path_sum.py class Solution (line 11) | class Solution: method hasPathSum (line 12) | def hasPathSum(self, root, target): FILE: leetcode/113_path_sum_ii.py class Solution (line 11) | class Solution: method pathSum (line 12) | def pathSum(self, root, target): method dfs (line 27) | def dfs(self, node, remaining, ans, path): FILE: leetcode/116_populating_next_right_pointers_in_each_node.py class Solution (line 12) | class Solution: method connect (line 16) | def connect(self, root): method connect (line 40) | def connect(self, root): class Solution (line 36) | class Solution: method connect (line 16) | def connect(self, root): method connect (line 40) | def connect(self, root): FILE: leetcode/117_populating_next_right_pointers_in_each_node_ii.py class Solution (line 12) | class Solution: method connect (line 18) | def connect(self, root): method connect (line 53) | def connect(self, root): method connect (line 86) | def connect(self, root): class Solution (line 49) | class Solution: method connect (line 18) | def connect(self, root): method connect (line 53) | def connect(self, root): method connect (line 86) | def connect(self, root): class Solution (line 82) | class Solution: method connect (line 18) | def connect(self, root): method connect (line 53) | def connect(self, root): method connect (line 86) | def connect(self, root): FILE: leetcode/118_pascal_s_triangle.py class Solution (line 1) | class Solution: method generate (line 2) | def generate(self, num_rows): method generate (line 26) | def generate(self, num_rows): class Solution (line 25) | class Solution: method generate (line 2) | def generate(self, num_rows): method generate (line 26) | def generate(self, num_rows): FILE: leetcode/11_container_with_most_water.py class Solution (line 1) | class Solution: method maxArea (line 2) | def maxArea(self, H): FILE: leetcode/124_binary_tree_maximum_path_sum.py class Solution (line 11) | class Solution: method maxPathSum (line 12) | def maxPathSum(self, root): method divide_conquer (line 23) | def divide_conquer(self, node): method maxPathSum (line 38) | def maxPathSum(self, root): method divide_conquer (line 50) | def divide_conquer(self, node): class Solution (line 37) | class Solution: method maxPathSum (line 12) | def maxPathSum(self, root): method divide_conquer (line 23) | def divide_conquer(self, node): method maxPathSum (line 38) | def maxPathSum(self, root): method divide_conquer (line 50) | def divide_conquer(self, node): FILE: leetcode/134_gas_station.py class Solution (line 1) | class Solution: method canCompleteCircuit (line 7) | def canCompleteCircuit(self, gas, cost): method canCompleteCircuit (line 36) | def canCompleteCircuit(self, gas, cost): class Solution (line 32) | class Solution: method canCompleteCircuit (line 7) | def canCompleteCircuit(self, gas, cost): method canCompleteCircuit (line 36) | def canCompleteCircuit(self, gas, cost): FILE: leetcode/136_single_number.py class Solution (line 1) | class Solution: method singleNumber (line 2) | def singleNumber(self, nums): FILE: leetcode/149_max_points_on_a_line.py class Solution (line 8) | class Solution: method maxPoints (line 9) | def maxPoints(self, P): method get_gcd (line 48) | def get_gcd(self, a, b): FILE: leetcode/14_longest_common_prefix.py class Solution (line 1) | class Solution: method longestCommonPrefix (line 2) | def longestCommonPrefix(self, strs): FILE: leetcode/150_evaluate_reverse_polish_notation.py class Solution (line 1) | class Solution: method evalRPN (line 2) | def evalRPN(self, E): FILE: leetcode/157_read_n_characters_given_read4.py class Solution (line 11) | class Solution: method read (line 12) | def read(self, buf, n): function read4 (line 43) | def read4(buf): FILE: leetcode/160_intersection_of_two_linked_lists.py class Solution (line 8) | class Solution(object): method getIntersectionNode (line 9) | def getIntersectionNode(self, A, B): FILE: leetcode/165_compare_version_numbers.py class Solution (line 1) | class Solution: method compareVersion (line 2) | def compareVersion(self, version1, version2): method get_int (line 30) | def get_int(self, s): FILE: leetcode/166_fraction_to_recurring_decimal.py class Solution (line 1) | class Solution: method fractionToDecimal (line 2) | def fractionToDecimal(self, a, b): FILE: leetcode/169_majority_element.py class Solution (line 1) | class Solution: method majorityElement (line 2) | def majorityElement(self, nums): method majorityElement (line 25) | def majorityElement(self, nums): method majorityElement (line 39) | def majorityElement(self, nums): class Solution (line 24) | class Solution: method majorityElement (line 2) | def majorityElement(self, nums): method majorityElement (line 25) | def majorityElement(self, nums): method majorityElement (line 39) | def majorityElement(self, nums): class Solution (line 38) | class Solution: method majorityElement (line 2) | def majorityElement(self, nums): method majorityElement (line 25) | def majorityElement(self, nums): method majorityElement (line 39) | def majorityElement(self, nums): FILE: leetcode/171_excel_sheet_column_number.py class Solution (line 1) | class Solution: method titleToNumber (line 2) | def titleToNumber(self, s): FILE: leetcode/172_factorial_trailing_zeroes.py class Solution (line 1) | class Solution: method trailingZeroes (line 2) | def trailingZeroes(self, n): FILE: leetcode/174_dungeon_game.py class Solution (line 1) | class Solution: method calculateMinimumHP (line 2) | def calculateMinimumHP(self, G): FILE: leetcode/179_largest_number.py class LgSort (line 6) | class LgSort(str): method __lt__ (line 7) | def __lt__(a, b): class Solution (line 11) | class Solution: method largestNumber (line 12) | def largestNumber(self, A): FILE: leetcode/17_letter_combinations_of_a_phone_number.py class Solution (line 1) | class Solution: method letterCombinations (line 2) | def letterCombinations(self, s): FILE: leetcode/190_reverse_bits.py class Solution (line 2) | class Solution: method reverseBits (line 5) | def reverseBits(self, n): method reverseBits (line 27) | def reverseBits(self, n): class Solution (line 24) | class Solution: method reverseBits (line 5) | def reverseBits(self, n): method reverseBits (line 27) | def reverseBits(self, n): FILE: leetcode/191_number_of_1_bits.py class Solution (line 1) | class Solution: method hammingWeight (line 2) | def hammingWeight(self, n): FILE: leetcode/19_remove_nth_node_from_end_of_list.py class Solution (line 10) | class Solution: method removeNthFromEnd (line 11) | def removeNthFromEnd(self, head, n): FILE: leetcode/202_happy_number.py class Solution (line 1) | class Solution: method isHappy (line 2) | def isHappy(self, n): method square_sum (line 18) | def square_sum(self, a): FILE: leetcode/204_count_primes.py class Solution (line 8) | class Solution: method countPrimes (line 9) | def countPrimes(self, n): FILE: leetcode/208_implement_trie_prefix_tree.py class TrieNode (line 1) | class TrieNode: method __init__ (line 2) | def __init__(self, val=None): class Trie (line 7) | class Trie: method __init__ (line 8) | def __init__(self): method insert (line 11) | def insert(self, word): method search (line 27) | def search(self, word): method startsWith (line 43) | def startsWith(self, prefix): FILE: leetcode/20_valid_parentheses.py class Solution (line 1) | class Solution: method isValid (line 2) | def isValid(self, s): FILE: leetcode/215_kth_largest_element_in_an_array.py class Solution (line 4) | class Solution: method findKthLargest (line 5) | def findKthLargest(self, A, k): FILE: leetcode/217_contains_duplicate.py class Solution (line 1) | class Solution: method containsDuplicate (line 2) | def containsDuplicate(self, A): FILE: leetcode/218_the_skyline_problem.py class HashHeapq (line 7) | class HashHeapq: method __init__ (line 8) | def __init__(self): method push (line 12) | def push(self, val): method pop (line 15) | def pop(self): method remove (line 21) | def remove(self, val): method top (line 30) | def top(self): method is_empty (line 36) | def is_empty(self): class Solution (line 44) | class Solution: method getSkyline (line 45) | def getSkyline(self, buildings): FILE: leetcode/224_basic_calculator.py class Solution (line 1) | class Solution: method calculate (line 2) | def calculate(self, s): method to_rpn (line 22) | def to_rpn(self, s): method eval_rpn (line 48) | def eval_rpn(self, s): method calculate (line 63) | def calculate(self, s): method to_rpn (line 78) | def to_rpn(self, s): method eval_rpn (line 104) | def eval_rpn(self, s): class Solution (line 62) | class Solution: method calculate (line 2) | def calculate(self, s): method to_rpn (line 22) | def to_rpn(self, s): method eval_rpn (line 48) | def eval_rpn(self, s): method calculate (line 63) | def calculate(self, s): method to_rpn (line 78) | def to_rpn(self, s): method eval_rpn (line 104) | def eval_rpn(self, s): FILE: leetcode/227_basic_calculator_ii.py class Solution (line 1) | class Solution: method calculate (line 2) | def calculate(self, s): method to_rpn (line 27) | def to_rpn(self, s, P): method eval_rpn (line 53) | def eval_rpn(self, s, OP): method calculate (line 68) | def calculate(self, s): method to_rpn (line 83) | def to_rpn(self, s): method eval_rpn (line 111) | def eval_rpn(self, s): class Solution (line 67) | class Solution: method calculate (line 2) | def calculate(self, s): method to_rpn (line 27) | def to_rpn(self, s, P): method eval_rpn (line 53) | def eval_rpn(self, s, OP): method calculate (line 68) | def calculate(self, s): method to_rpn (line 83) | def to_rpn(self, s): method eval_rpn (line 111) | def eval_rpn(self, s): FILE: leetcode/229_majority_element_ii.py class Solution (line 1) | class Solution: method majorityElement (line 2) | def majorityElement(self, nums): FILE: leetcode/22_generate_parentheses.py class Solution (line 1) | class Solution: method generateParenthesis (line 2) | def generateParenthesis(self, n): method dfs (line 14) | def dfs(self, n, lcnt, rcnt, ans, path): FILE: leetcode/230_kth_smallest_element_in_a_bst.py class Solution (line 11) | class Solution: method kthSmallest (line 12) | def kthSmallest(self, root, k): FILE: leetcode/234_palindrome_linked_list.py class Solution (line 8) | class Solution: method isPalindrome (line 9) | def isPalindrome(self, head): method isPalindrome (line 32) | def isPalindrome(self, head): class Solution (line 31) | class Solution: method isPalindrome (line 9) | def isPalindrome(self, head): method isPalindrome (line 32) | def isPalindrome(self, head): FILE: leetcode/235_lowest_common_ancestor_of_a_binary_search_tree.py class Solution (line 9) | class Solution(object): method lowestCommonAncestor (line 10) | def lowestCommonAncestor(self, root, p, q): FILE: leetcode/236_lowest_common_ancestor_of_a_binary_tree.py class Solution (line 9) | class Solution(object): method lowestCommonAncestor (line 10) | def lowestCommonAncestor(self, root, p, q): FILE: leetcode/237_delete_node_in_a_linked_list.py class Solution (line 8) | class Solution(object): method deleteNode (line 9) | def deleteNode(self, node): FILE: leetcode/242_valid_anagram.py class Solution (line 1) | class Solution: method isAnagram (line 2) | def isAnagram(self, s, t): FILE: leetcode/269_alien_dictionary.py class Solution (line 1) | class Solution: method alienOrder (line 2) | def alienOrder(self, words): method alienOrder (line 32) | def alienOrder(self, words): class Solution (line 28) | class Solution: method alienOrder (line 2) | def alienOrder(self, words): method alienOrder (line 32) | def alienOrder(self, words): FILE: leetcode/277_find_the_celebrity.py class Solution (line 6) | class Solution: method findCelebrity (line 7) | def findCelebrity(self, n): FILE: leetcode/280_wiggle_sort.py class Solution (line 1) | class Solution: method wiggleSort (line 2) | def wiggleSort(self, nums): FILE: leetcode/282_expression_add_operators.py class Solution (line 8) | class Solution: method addOperators (line 9) | def addOperators(self, s, target): method dfs (line 23) | def dfs(self, s, start, target, val, multi, ans, path): FILE: leetcode/285_inorder_successor_in_bst.py class Solution (line 70) | class Solution: method inorderSuccessor (line 77) | def inorderSuccessor(self, root, target): class Solution2 (line 104) | class Solution2: method inorderSuccessor (line 110) | def inorderSuccessor(self, root, target): class Solution3 (line 138) | class Solution3: method inorderSuccessor (line 146) | def inorderSuccessor(self, root, target): class Solution4 (line 171) | class Solution4: method inorderSuccessor (line 179) | def inorderSuccessor(self, root, target): FILE: leetcode/288_unique_word_abbreviation.py class ValidWordAbbr (line 19) | class ValidWordAbbr: method __init__ (line 20) | def __init__(self, dictionary): method isUnique (line 31) | def isUnique(self, word): method abbreviation (line 40) | def abbreviation(self, word): FILE: leetcode/289_game_of_life.py class Solution (line 11) | class Solution: method gameOfLife (line 15) | def gameOfLife(self, board): method get_live_neibs (line 38) | def get_live_neibs(self, board, x, y): method gameOfLife (line 62) | def gameOfLife(self, board): method get_live_neibs (line 93) | def get_live_neibs(self, board, x, y): class Solution (line 58) | class Solution: method gameOfLife (line 15) | def gameOfLife(self, board): method get_live_neibs (line 38) | def get_live_neibs(self, board, x, y): method gameOfLife (line 62) | def gameOfLife(self, board): method get_live_neibs (line 93) | def get_live_neibs(self, board, x, y): FILE: leetcode/295_find_median_from_data_stream.py class MedianFinder (line 10) | class MedianFinder: method __init__ (line 11) | def __init__(self): method addNum (line 15) | def addNum(self, num): method findMedian (line 25) | def findMedian(self): FILE: leetcode/299_bulls_and_cows.py class Solution (line 1) | class Solution: method getHint (line 2) | def getHint(self, secret, guess): method getHint (line 36) | def getHint(self, secret, guess): class Solution (line 35) | class Solution: method getHint (line 2) | def getHint(self, secret, guess): method getHint (line 36) | def getHint(self, secret, guess): FILE: leetcode/303_range_sum_query_immutable.py class NumArray (line 8) | class NumArray: method __init__ (line 9) | def __init__(self, nums): method sumRange (line 22) | def sumRange(self, i, j): FILE: leetcode/304_range_sum_query_2d_immutable.py class NumMatrix (line 8) | class NumMatrix: method __init__ (line 9) | def __init__(self, matrix): method sumRegion (line 28) | def sumRegion(self, x1, y1, x2, y2): FILE: leetcode/307_range_sum_query_mutable.py class NumArray (line 12) | class NumArray: method __init__ (line 13) | def __init__(self, nums): method update (line 27) | def update(self, i, val): method sumRange (line 44) | def sumRange(self, i, j): method sum (line 52) | def sum(self, i): FILE: leetcode/308_range_sum_query_2d_mutable.py class NumMatrix (line 9) | class NumMatrix: method __init__ (line 10) | def __init__(self, matrix): method update (line 25) | def update(self, x, y, val): method sumRegion (line 47) | def sumRegion(self, x1, y1, x2, y2): method sum (line 62) | def sum(self, x, y): FILE: leetcode/30_substring_with_concatenation_of_all_words.py class Solution (line 1) | class Solution: method findSubstring (line 2) | def findSubstring(self, s, S): FILE: leetcode/315_count_of_smaller_numbers_after_self.py class Solution (line 1) | class Solution: method countSmaller (line 5) | def countSmaller(self, nums): method update (line 27) | def update(self, i): method sum (line 34) | def sum(self, i): method countSmaller (line 48) | def countSmaller(self, nums): class Solution (line 44) | class Solution: method countSmaller (line 5) | def countSmaller(self, nums): method update (line 27) | def update(self, i): method sum (line 34) | def sum(self, i): method countSmaller (line 48) | def countSmaller(self, nums): FILE: leetcode/323_number_of_connected_components_in_an_undirected_graph.py class Solution (line 17) | class Solution: method countComponents (line 21) | def countComponents(self, n, edges): method union (line 40) | def union(self, nodes, a, b): method find (line 50) | def find(self, nodes, a): class Solution2 (line 61) | class Solution2: method countComponents (line 65) | def countComponents(self, n, edges): method dfs (line 96) | def dfs(self, a, adj, visited): FILE: leetcode/324_wiggle_sort_ii.py class Solution (line 6) | class Solution: method wiggleSort (line 7) | def wiggleSort(self, A): FILE: leetcode/326_power_of_three.py class Solution (line 1) | class Solution: method isPowerOfThree (line 2) | def isPowerOfThree(self, n): FILE: leetcode/329_longest_increasing_path_in_a_matrix.py class Solution (line 1) | class Solution: method longestIncreasingPath (line 2) | def longestIncreasingPath(self, G): method dfs (line 28) | def dfs(self, G, x, y, memo): FILE: leetcode/334_increasing_triplet_subsequence.py class Solution (line 1) | class Solution: method increasingTriplet (line 2) | def increasingTriplet(self, A): FILE: leetcode/33_search_in_rotated_sorted_array.py class Solution (line 1) | class Solution: method search (line 2) | def search(self, nums, target): FILE: leetcode/340_longest_substring_with_at_most_k_distinct_characters.py class Solution (line 10) | class Solution: method lengthOfLongestSubstringKDistinct (line 11) | def lengthOfLongestSubstringKDistinct(self, s, k): FILE: leetcode/344_reverse_string.py class Solution (line 1) | class Solution: method reverseString (line 2) | def reverseString(self, s): FILE: leetcode/347_top_k_frequent_elements.py class Solution (line 1) | class Solution: method topKFrequent (line 2) | def topKFrequent(self, A, k): FILE: leetcode/348_design_tic_tac_toe.py class TicTacToe (line 1) | class TicTacToe(object): method __init__ (line 5) | def __init__(self, n): method move (line 15) | def move(self, x, y, player): FILE: leetcode/353_design_snake_game.py class SnakeGame (line 38) | class SnakeGame: method __init__ (line 39) | def __init__(self, width, height, food): method move (line 71) | def move(self, direction): FILE: leetcode/36_valid_sudoku.py class Solution (line 1) | class Solution: method isValidSudoku (line 2) | def isValidSudoku(self, board): FILE: leetcode/377_combination_sum_iv.py class Solution (line 8) | class Solution: method combinationSum4 (line 12) | def combinationSum4(self, nums, target): method combinationSum4 (line 40) | def combinationSum4(self, nums, target): method memo_search (line 54) | def memo_search(self, nums, remain, dp): method combinationSum4 (line 74) | def combinationSum4(self, nums, target): method dfs (line 89) | def dfs(self, nums, remain, ans, path): method combinationSum4 (line 112) | def combinationSum4(self, nums, target): class Solution (line 34) | class Solution: method combinationSum4 (line 12) | def combinationSum4(self, nums, target): method combinationSum4 (line 40) | def combinationSum4(self, nums, target): method memo_search (line 54) | def memo_search(self, nums, remain, dp): method combinationSum4 (line 74) | def combinationSum4(self, nums, target): method dfs (line 89) | def dfs(self, nums, remain, ans, path): method combinationSum4 (line 112) | def combinationSum4(self, nums, target): class Solution (line 70) | class Solution: method combinationSum4 (line 12) | def combinationSum4(self, nums, target): method combinationSum4 (line 40) | def combinationSum4(self, nums, target): method memo_search (line 54) | def memo_search(self, nums, remain, dp): method combinationSum4 (line 74) | def combinationSum4(self, nums, target): method dfs (line 89) | def dfs(self, nums, remain, ans, path): method combinationSum4 (line 112) | def combinationSum4(self, nums, target): class Solution (line 106) | class Solution: method combinationSum4 (line 12) | def combinationSum4(self, nums, target): method combinationSum4 (line 40) | def combinationSum4(self, nums, target): method memo_search (line 54) | def memo_search(self, nums, remain, dp): method combinationSum4 (line 74) | def combinationSum4(self, nums, target): method dfs (line 89) | def dfs(self, nums, remain, ans, path): method combinationSum4 (line 112) | def combinationSum4(self, nums, target): FILE: leetcode/378_kth_smallest_element_in_a_sorted_matrix.py class Solution (line 4) | class Solution: method kthSmallest (line 5) | def kthSmallest(self, G, k): FILE: leetcode/37_sudoku_solver.py class Solution (line 1) | class Solution: method solveSudoku (line 2) | def solveSudoku(self, board): method dfs (line 12) | def dfs(self, board, x, y): method is_valid (line 40) | def is_valid(self, board, x, y): FILE: leetcode/380_insert_delete_getrandom_o1.py class RandomizedSet (line 11) | class RandomizedSet: method __init__ (line 12) | def __init__(self): method insert (line 16) | def insert(self, val): method remove (line 25) | def remove(self, val): method getRandom (line 44) | def getRandom(self): FILE: leetcode/381_insert_delete_getrandom_o1_duplicates_allowed.py class RandomizedCollection (line 4) | class RandomizedCollection: method __init__ (line 5) | def __init__(self): method insert (line 9) | def insert(self, val): method remove (line 23) | def remove(self, val): method getRandom (line 43) | def getRandom(self): FILE: leetcode/382_linked_list_random_node.py class Solution (line 10) | class Solution: method __init__ (line 11) | def __init__(self, head): method getRandom (line 19) | def getRandom(self): FILE: leetcode/384_shuffle_an_array.py class Solution (line 4) | class Solution: method __init__ (line 5) | def __init__(self, nums): method reset (line 12) | def reset(self): method shuffle (line 20) | def shuffle(self): FILE: leetcode/386_lexicographical_numbers.py class Solution (line 1) | class Solution: method lexicalOrder (line 2) | def lexicalOrder(self, n): FILE: leetcode/387_first_unique_character_in_a_string.py class Solution (line 1) | class Solution: method firstUniqChar (line 2) | def firstUniqChar(self, s): FILE: leetcode/388_longest_absolute_file_path.py class Solution (line 28) | class Solution: method lengthLongestPath (line 29) | def lengthLongestPath(self, path): FILE: leetcode/389_find_the_difference.py class Solution (line 1) | class Solution: method findTheDifference (line 2) | def findTheDifference(self, s, t): method findTheDifference (line 19) | def findTheDifference(self, s, t): class Solution (line 18) | class Solution: method findTheDifference (line 2) | def findTheDifference(self, s, t): method findTheDifference (line 19) | def findTheDifference(self, s, t): FILE: leetcode/38_count_and_say.py class Solution (line 1) | class Solution: method countAndSay (line 2) | def countAndSay(self, N): FILE: leetcode/390_elimination_game.py class Solution (line 1) | class Solution: method lastRemaining (line 2) | def lastRemaining(self, n): FILE: leetcode/391_perfect_rectangle.py class Solution (line 4) | class Solution: method isRectangleCover (line 5) | def isRectangleCover(self, recs): FILE: leetcode/395_longest_substring_with_at_least_k_repeating_characters.py class Solution (line 1) | class Solution: method longestSubstring (line 2) | def longestSubstring(self, s, k): FILE: leetcode/398_random_pick_index.py class Solution (line 4) | class Solution: method __init__ (line 5) | def __init__(self, A): method pick (line 11) | def pick(self, target): FILE: leetcode/399_evaluate_division.py class Solution (line 4) | class Solution: method calcEquation (line 5) | def calcEquation(self, equations, values, queries): method dfs (line 38) | def dfs(self, a, b, val, nexts, evals, visited): FILE: leetcode/406_queue_reconstruction_by_height.py class Solution (line 31) | class Solution: method reconstructQueue (line 32) | def reconstructQueue(self, people): method reconstructQueue (line 51) | def reconstructQueue(self, people): class Solution (line 50) | class Solution: method reconstructQueue (line 32) | def reconstructQueue(self, people): method reconstructQueue (line 51) | def reconstructQueue(self, people): FILE: leetcode/416_partition_equal_subset_sum.py class Solution (line 9) | class Solution: method canPartition (line 10) | def canPartition(self, nums): FILE: leetcode/417_pacific_atlantic_water_flow.py class Solution (line 1) | class Solution: method pacificAtlantic (line 10) | def pacificAtlantic(self, matrix): method bfs (line 38) | def bfs(self, matrix, queue, visited): method pacificAtlantic (line 64) | def pacificAtlantic(self, matrix): method dfs (line 86) | def dfs(self, matrix, x, y, visited): class Solution (line 60) | class Solution: method pacificAtlantic (line 10) | def pacificAtlantic(self, matrix): method bfs (line 38) | def bfs(self, matrix, queue, visited): method pacificAtlantic (line 64) | def pacificAtlantic(self, matrix): method dfs (line 86) | def dfs(self, matrix, x, y, visited): FILE: leetcode/41_first_missing_positive.py class Solution (line 6) | class Solution: method firstMissingPositive (line 7) | def firstMissingPositive(self, A): FILE: leetcode/437_path_sum_iii.py class Solution (line 11) | class Solution: method pathSum (line 15) | def pathSum(self, root, target): method count_valid_path (line 30) | def count_valid_path(self, node, remaining): method pathSum (line 45) | def pathSum(self, root, target): method dfs (line 60) | def dfs(self, node, target, ans, path): class Solution (line 41) | class Solution: method pathSum (line 15) | def pathSum(self, root, target): method count_valid_path (line 30) | def count_valid_path(self, node, remaining): method pathSum (line 45) | def pathSum(self, root, target): method dfs (line 60) | def dfs(self, node, target, ans, path): FILE: leetcode/454_4sum_ii.py class Solution (line 1) | class Solution: method fourSumCount (line 2) | def fourSumCount(self, A, B, C, D): FILE: leetcode/461_hamming_distance.py class Solution (line 1) | class Solution: method hammingDistance (line 2) | def hammingDistance(self, x, y): FILE: leetcode/480_sliding_window_median.py class HashHeapq (line 4) | class HashHeapq: method __init__ (line 5) | def __init__(self): method __repr__ (line 8) | def __repr__(self): method __len__ (line 11) | def __len__(self): method __bool__ (line 14) | def __bool__(self): method push (line 17) | def push(self, val): method pop (line 20) | def pop(self): method remove (line 26) | def remove(self, val): method top (line 47) | def top(self): class Solution (line 54) | class Solution: method medianSlidingWindow (line 55) | def medianSlidingWindow(self, nums, k): method get_median (line 89) | def get_median(self): FILE: leetcode/486_predict_the_winner.py class Solution (line 6) | class Solution: method PredictTheWinner (line 7) | def PredictTheWinner(self, nums): method PredictTheWinner (line 34) | def PredictTheWinner(self, nums): class Solution (line 33) | class Solution: method PredictTheWinner (line 7) | def PredictTheWinner(self, nums): method PredictTheWinner (line 34) | def PredictTheWinner(self, nums): FILE: leetcode/48_rotate_image.py class Solution (line 1) | class Solution: method rotate (line 2) | def rotate(self, matrix): method rotate (line 28) | def rotate(self, matrix): class Solution (line 27) | class Solution: method rotate (line 2) | def rotate(self, matrix): method rotate (line 28) | def rotate(self, matrix): FILE: leetcode/490_the_maze.py class Solution (line 1) | class Solution: method hasPath (line 2) | def hasPath(self, maze, start, destination): method dfs (line 30) | def dfs(self, maze, x, y, tx, ty, visited): FILE: leetcode/494_target_sum.py class Solution (line 16) | class Solution: method findTargetSumWays (line 17) | def findTargetSumWays(self, A, target): method subset_sum (line 32) | def subset_sum(self, A, target): FILE: leetcode/499_the_maze_iii.py class Solution (line 1) | class Solution: method findShortestWay (line 5) | def findShortestWay(self, maze, ball, hole): class Solution2 (line 78) | class Solution2: method findShortestWay (line 82) | def findShortestWay(self, maze, ball, hole): FILE: leetcode/505_the_maze_ii.py class Solution (line 1) | class Solution: method shortestDistance (line 5) | def shortestDistance(self, maze, start, destination): class Solution2 (line 67) | class Solution2: method shortestDistance (line 71) | def shortestDistance(self, maze, start, destination): FILE: leetcode/518_coin_change_2.py class Solution (line 1) | class Solution: method change (line 2) | def change(self, amount, coins): FILE: leetcode/51_n_queens.py class Solution (line 1) | class Solution: method solveNQueens (line 2) | def solveNQueens(self, n): method dfs (line 15) | def dfs(self, G, y, ans): method is_valid (line 26) | def is_valid(self, G, x, y): method clone_board (line 45) | def clone_board(self, G): FILE: leetcode/524_longest_word_in_dictionary_through_deleting.py class Solution (line 1) | class Solution: method findLongestWord (line 7) | def findLongestWord(self, s, words): method is_subseq (line 27) | def is_subseq(self, s, t): method findLongestWord (line 46) | def findLongestWord(self, s, words): method find_cands (line 70) | def find_cands(self, s, i, cands, path): class Solution (line 42) | class Solution: method findLongestWord (line 7) | def findLongestWord(self, s, words): method is_subseq (line 27) | def is_subseq(self, s, t): method findLongestWord (line 46) | def findLongestWord(self, s, words): method find_cands (line 70) | def find_cands(self, s, i, cands, path): FILE: leetcode/52_n_queens_ii.py class Solution (line 1) | class Solution: method totalNQueens (line 2) | def totalNQueens(self, n): method divide_conquer (line 12) | def divide_conquer(self, n, y, cnt, Xs, DLs, DRs): FILE: leetcode/530_minimum_absolute_difference_in_bst.py class Solution (line 11) | class Solution: method getMinimumDifference (line 19) | def getMinimumDifference(self, root): FILE: leetcode/542_01_matrix.py class Solution (line 1) | class Solution: method updateMatrix (line 2) | def updateMatrix(self, matrix): FILE: leetcode/54_spiral_matrix.py class Solution (line 1) | class Solution: method spiralOrder (line 2) | def spiralOrder(self, matrix): FILE: leetcode/592_fraction_addition_and_subtraction.py class Solution (line 4) | class Solution: method fractionAddition (line 5) | def fractionAddition(self, E): method get_gcd (line 45) | def get_gcd(self, a, b): FILE: leetcode/593_valid_square.py class Solution (line 1) | class Solution: method validSquare (line 2) | def validSquare(self, p1, p2, p3, p4): method get_distance (line 34) | def get_distance(self, a, b): FILE: leetcode/59_spiral_matrix_ii.py class Solution (line 1) | class Solution: method generateMatrix (line 2) | def generateMatrix(self, n): FILE: leetcode/5_longest_palindromic_substring.py class Solution (line 1) | class Solution: method longestPalindrome (line 2) | def longestPalindrome(self, s): method check_palindrome (line 27) | def check_palindrome(self, s, left, right): FILE: leetcode/616_add_bold_tag_in_string.py class Solution (line 18) | class Solution: method addBoldTag (line 19) | def addBoldTag(self, s, words): FILE: leetcode/643_maximum_average_subarray_i.py class Solution (line 1) | class Solution: method findMaxAverage (line 2) | def findMaxAverage(self, nums, k): method findMaxAverage (line 27) | def findMaxAverage(self, nums, k): class Solution (line 26) | class Solution: method findMaxAverage (line 2) | def findMaxAverage(self, nums, k): method findMaxAverage (line 27) | def findMaxAverage(self, nums, k): FILE: leetcode/66_plus_one.py class Solution (line 1) | class Solution: method plusOne (line 2) | def plusOne(self, digits): method plusOne (line 28) | def plusOne(self, digits): class Solution (line 27) | class Solution: method plusOne (line 2) | def plusOne(self, digits): method plusOne (line 28) | def plusOne(self, digits): FILE: leetcode/676_implement_magic_dictionary.py class MagicDictionary (line 9) | class MagicDictionary: method __init__ (line 10) | def __init__(self): method buildDict (line 16) | def buildDict(self, words): method search (line 32) | def search(self, word): FILE: leetcode/679_24_game.py class Solution (line 1) | class Solution: method judgePoint24 (line 10) | def judgePoint24(self, nums): FILE: leetcode/681_next_closest_time.py class Solution (line 25) | class Solution: method nextClosestTime (line 26) | def nextClosestTime(self, time): method is_valid (line 60) | def is_valid(self, ids, digits): FILE: leetcode/682_baseball_game.py class Solution (line 1) | class Solution: method calPoints (line 2) | def calPoints(self, ops): FILE: leetcode/683_k_empty_slots.py class Solution (line 17) | class Solution: method kEmptySlots (line 21) | def kEmptySlots(self, flowers, k): class Solution2 (line 40) | class Solution2: method kEmptySlots (line 45) | def kEmptySlots(self, flowers, k): FILE: leetcode/684_redundant_connection.py class Solution (line 10) | class Solution: method findRedundantConnection (line 14) | def findRedundantConnection(self, edges): method union (line 30) | def union(self, nodes, u, v): method find (line 40) | def find(self, nodes, u): method findRedundantConnection (line 58) | def findRedundantConnection(self, edges): method dfs (line 78) | def dfs(self, nodes, u, v, visited): class Solution (line 54) | class Solution: method findRedundantConnection (line 14) | def findRedundantConnection(self, edges): method union (line 30) | def union(self, nodes, u, v): method find (line 40) | def find(self, nodes, u): method findRedundantConnection (line 58) | def findRedundantConnection(self, edges): method dfs (line 78) | def dfs(self, nodes, u, v, visited): FILE: leetcode/685_redundant_connection_ii.py class Solution (line 17) | class Solution: method findRedundantDirectedConnection (line 18) | def findRedundantDirectedConnection(self, edges): method union (line 45) | def union(self, uf, u, v): method find (line 55) | def find(self, uf, u): method dfs (line 65) | def dfs(self, u, adj, visited): FILE: leetcode/688_knight_probability_in_chessboard.py class Solution (line 4) | class Solution: method knightProbability (line 11) | def knightProbability(self, n, k, r, c): method knightProbability (line 54) | def knightProbability(self, n, k, r, c): class Solution (line 50) | class Solution: method knightProbability (line 11) | def knightProbability(self, n, k, r, c): method knightProbability (line 54) | def knightProbability(self, n, k, r, c): FILE: leetcode/689_maximum_sum_of_3_non_overlapping_subarrays.py class Solution (line 6) | class Solution: method maxSumOfThreeSubarrays (line 7) | def maxSumOfThreeSubarrays(self, A, k): FILE: leetcode/697_degree_of_an_array.py class Solution (line 1) | class Solution: method findShortestSubArray (line 2) | def findShortestSubArray(self, A): FILE: leetcode/719_find_k_th_smallest_pair_distance.py class Solution (line 1) | class Solution: method smallestDistancePair (line 2) | def smallestDistancePair(self, A, k): method check_valid (line 23) | def check_valid(self, A, mid, k): FILE: leetcode/721_accounts_merge.py class Solution (line 1) | class Solution: method accountsMerge (line 2) | def accountsMerge(self, A): method connect (line 29) | def connect(self, N, a, b): method find (line 36) | def find(self, N, a): FILE: leetcode/734_sentence_similarity.py class Solution (line 22) | class Solution: method areSentencesSimilar (line 23) | def areSentencesSimilar(self, words1, words2, pairs): FILE: leetcode/737_sentence_similarity_ii.py class Solution (line 19) | class Solution: method areSentencesSimilarTwo (line 23) | def areSentencesSimilarTwo(self, words1, words2, pairs): method union (line 49) | def union(self, nodes, a, b): method find (line 58) | def find(self, nodes, a): class Solution2 (line 72) | class Solution2: method areSentencesSimilarTwo (line 76) | def areSentencesSimilarTwo(self, words1, words2, pairs): method dfs (line 101) | def dfs(self, start, end, simils, path): FILE: leetcode/744_find_smallest_letter_greater_than_target.py class Solution (line 1) | class Solution: method nextGreatestLetter (line 2) | def nextGreatestLetter(self, L, target): FILE: leetcode/746_min_cost_climbing_stairs.py class Solution (line 1) | class Solution: method minCostClimbingStairs (line 2) | def minCostClimbingStairs(self, cost): FILE: leetcode/747_largest_number_at_least_twice_of_others.py class Solution (line 1) | class Solution: method dominantIndex (line 2) | def dominantIndex(self, A): FILE: leetcode/748_shortest_completing_word.py class Solution (line 1) | class Solution: method shortestCompletingWord (line 2) | def shortestCompletingWord(self, P, words): method is_included (line 24) | def is_included(self, a_times, b_times): method get_times (line 35) | def get_times(self, word): FILE: leetcode/749_contain_virus.py class Solution (line 16) | class Solution: method containVirus (line 28) | def containVirus(self, G): method build_walls (line 47) | def build_walls(self, G): method dfs (line 83) | def dfs(self, x, y, G, visited, ex_virus, spreading, walls): FILE: leetcode/750_number_of_corner_rectangles.py class Solution (line 1) | class Solution: method countCornerRectangles (line 2) | def countCornerRectangles(self, G): FILE: leetcode/758_bold_words_in_string.py class Solution (line 18) | class Solution: method boldWords (line 19) | def boldWords(self, words, s): FILE: leetcode/769_max_chunks_to_make_sorted.py class Solution (line 23) | class Solution: method maxChunksToSorted (line 24) | def maxChunksToSorted(self, nums): method maxChunksToSorted (line 46) | def maxChunksToSorted(self, nums): class Solution (line 45) | class Solution: method maxChunksToSorted (line 24) | def maxChunksToSorted(self, nums): method maxChunksToSorted (line 46) | def maxChunksToSorted(self, nums): FILE: leetcode/776_split_bst.py class Solution (line 9) | class Solution: method splitBST (line 10) | def splitBST(self, root, target): FILE: leetcode/777_swap_adjacent_in_lr_string.py class Solution (line 1) | class Solution: method canTransform (line 2) | def canTransform(self, start, end): FILE: leetcode/778_swim_in_rising_water.py class Solution (line 4) | class Solution: method swimInWater (line 5) | def swimInWater(self, G): FILE: leetcode/779_k_th_symbol_in_grammar.py class Solution (line 1) | class Solution: method kthGrammar (line 2) | def kthGrammar(self, N, K): FILE: leetcode/783_minimum_distance_between_bst_nodes.py class Solution (line 11) | class Solution: method minDiffInBST (line 20) | def minDiffInBST(self, root): method minDiffInBST (line 45) | def minDiffInBST(self, root): class Solution (line 39) | class Solution: method minDiffInBST (line 20) | def minDiffInBST(self, root): method minDiffInBST (line 45) | def minDiffInBST(self, root): FILE: leetcode/784_letter_case_permutation.py class Solution (line 1) | class Solution: method letterCasePermutation (line 2) | def letterCasePermutation(self, s): method dfs (line 13) | def dfs(self, s, i, ans, path): FILE: leetcode/785_is_graph_bipartite.py class Solution (line 1) | class Solution: method isBipartite (line 2) | def isBipartite(self, graph): FILE: leetcode/786_k_th_smallest_prime_fraction.py class Solution (line 16) | class Solution: method kthSmallestPrimeFraction (line 17) | def kthSmallestPrimeFraction(self, A, K): FILE: leetcode/787_cheapest_flights_within_k_stops.py class Solution (line 1) | class Solution: method findCheapestPrice (line 2) | def findCheapestPrice(self, n, flights, src, dst, K): method findCheapestPrice (line 24) | def findCheapestPrice(self, n, flights, src, dst, K): class Solution (line 23) | class Solution: method findCheapestPrice (line 2) | def findCheapestPrice(self, n, flights, src, dst, K): method findCheapestPrice (line 24) | def findCheapestPrice(self, n, flights, src, dst, K): FILE: leetcode/788_rotated_digits.py class Solution (line 1) | class Solution: method rotatedDigits (line 2) | def rotatedDigits(self, N): method is_good (line 15) | def is_good(self, N): FILE: leetcode/789_escape_the_ghosts.py class Solution (line 1) | class Solution: method escapeGhosts (line 2) | def escapeGhosts(self, ghosts, target): FILE: leetcode/790_domino_and_tromino_tiling.py class Solution (line 1) | class Solution: method numTilings (line 2) | def numTilings(self, N): FILE: leetcode/791_custom_sort_string.py class Solution (line 1) | class Solution: method customSortString (line 2) | def customSortString(self, S, T): FILE: leetcode/7_reverse_integer.py class Solution (line 1) | class Solution: method reverse (line 2) | def reverse(self, x): FILE: leetcode/81_search_in_rotated_sorted_array_ii.py class Solution (line 1) | class Solution: method search (line 2) | def search(self, nums, target): FILE: leetcode/8_string_to_integer_atoi.py class Solution (line 1) | class Solution: method myAtoi (line 2) | def myAtoi(self, s): FILE: lintcode/102_linked_list_cycle.py class Solution (line 10) | class Solution: method hasCycle (line 15) | def hasCycle(self, head): FILE: lintcode/103_linked_list_cycle_ii.py class Solution (line 11) | class Solution: method detectCycle (line 16) | def detectCycle(self, head): FILE: lintcode/104_merge_k_sorted_lists.py class Solution (line 11) | class Solution: method mergeKLists (line 12) | def mergeKLists(self, lists): FILE: lintcode/105_copy_list_with_random_pointer.py class Solution (line 16) | class Solution: method copyRandomList (line 17) | def copyRandomList(self, head): method copyRandomList (line 64) | def copyRandomList(self, head): class Solution (line 63) | class Solution: method copyRandomList (line 17) | def copyRandomList(self, head): method copyRandomList (line 64) | def copyRandomList(self, head): FILE: lintcode/107_word_break.py class Solution (line 1) | class Solution: method wordBreak (line 5) | def wordBreak(self, s, words): FILE: lintcode/108_palindrome_partitioning_ii.py class Solution (line 1) | class Solution: method minCut (line 4) | def minCut(self, S): method get_palin_map (line 29) | def get_palin_map(self, S): FILE: lintcode/109_triangle.py class Solution (line 4) | class Solution: method minimumTotal (line 9) | def minimumTotal(self, triangle): method memo_search (line 15) | def memo_search(self, depth, start, triangle, memo): method minimumTotal (line 42) | def minimumTotal(self, triangle): method minimumTotal (line 84) | def minimumTotal(self, triangle): class Solution (line 37) | class Solution: method minimumTotal (line 9) | def minimumTotal(self, triangle): method memo_search (line 15) | def memo_search(self, depth, start, triangle, memo): method minimumTotal (line 42) | def minimumTotal(self, triangle): method minimumTotal (line 84) | def minimumTotal(self, triangle): class Solution (line 79) | class Solution: method minimumTotal (line 9) | def minimumTotal(self, triangle): method memo_search (line 15) | def memo_search(self, depth, start, triangle, memo): method minimumTotal (line 42) | def minimumTotal(self, triangle): method minimumTotal (line 84) | def minimumTotal(self, triangle): FILE: lintcode/10_string_permutation_ii.py class Solution (line 1) | class Solution: method stringPermutation2 (line 6) | def stringPermutation2(self, S): method dfs (line 16) | def dfs(self, S, ans, path): FILE: lintcode/110_minimum_path_sum.py class Solution (line 1) | class Solution: method minPathSum (line 6) | def minPathSum(self, grid): FILE: lintcode/111_climbing_stairs.py class Solution (line 4) | class Solution: method climbStairs (line 9) | def climbStairs(self, n): method climbStairs (line 36) | def climbStairs(self, n): method climbStairs (line 59) | def climbStairs(self, n): class Solution (line 31) | class Solution: method climbStairs (line 9) | def climbStairs(self, n): method climbStairs (line 36) | def climbStairs(self, n): method climbStairs (line 59) | def climbStairs(self, n): class Solution (line 54) | class Solution: method climbStairs (line 9) | def climbStairs(self, n): method climbStairs (line 36) | def climbStairs(self, n): method climbStairs (line 59) | def climbStairs(self, n): FILE: lintcode/114_unique_paths.py class Solution (line 1) | class Solution: method uniquePaths (line 2) | def uniquePaths(self, m, n): FILE: lintcode/115_unique_paths_ii.py class Solution (line 1) | class Solution: method uniquePathsWithObstacles (line 6) | def uniquePathsWithObstacles(self, G): FILE: lintcode/116_jump_game.py class Solution (line 6) | class Solution: method canJump (line 7) | def canJump(self, A): method canJump (line 28) | def canJump(self, A): class Solution (line 27) | class Solution: method canJump (line 7) | def canJump(self, A): method canJump (line 28) | def canJump(self, A): FILE: lintcode/117_jump_game_ii.py class Solution (line 4) | class Solution: method jump (line 9) | def jump(self, A): method jump (line 36) | def jump(self, A): class Solution (line 31) | class Solution: method jump (line 9) | def jump(self, A): method jump (line 36) | def jump(self, A): FILE: lintcode/118_distinct_subsequences.py class Solution (line 1) | class Solution: method numDistinct (line 7) | def numDistinct(self, S, T): FILE: lintcode/119_edit_distance.py class Solution (line 1) | class Solution: method minDistance (line 2) | def minDistance(self, s, t): FILE: lintcode/11_search_range_in_binary_search_tree.py class Solution (line 10) | class Solution: method searchRange (line 11) | def searchRange(self, root, a, b): method dfs (line 27) | def dfs(self, node, a, b, ans): FILE: lintcode/120_word_ladder.py class Solution (line 11) | class Solution: method ladderLength (line 12) | def ladderLength(self, s, e, D): method get_next_word (line 53) | def get_next_word(self, word, next_words): FILE: lintcode/121_word_ladder_ii.py class Solution (line 10) | class Solution: method findLadders (line 17) | def findLadders(self, A, B, D): method dfs (line 52) | def dfs(self, word, B, next_words, distance, ans, path): method get_next_word (line 65) | def get_next_word(self, word, next_words): FILE: lintcode/122_largest_rectangle_in_histogram.py class Solution (line 9) | class Solution: method largestRectangleArea (line 10) | def largestRectangleArea(self, H): method largestRectangleArea (line 40) | def largestRectangleArea(self, H): method largestRectangleArea (line 70) | def largestRectangleArea(self, H): class Solution (line 39) | class Solution: method largestRectangleArea (line 10) | def largestRectangleArea(self, H): method largestRectangleArea (line 40) | def largestRectangleArea(self, H): method largestRectangleArea (line 70) | def largestRectangleArea(self, H): class Solution (line 69) | class Solution: method largestRectangleArea (line 10) | def largestRectangleArea(self, H): method largestRectangleArea (line 40) | def largestRectangleArea(self, H): method largestRectangleArea (line 70) | def largestRectangleArea(self, H): FILE: lintcode/123_word_search.py class Solution (line 1) | class Solution: method exist (line 14) | def exist(self, G, s): method dfs (line 28) | def dfs(self, G, x, y, s, i, visited): FILE: lintcode/124_longest_consecutive_sequence.py class Solution (line 1) | class Solution: method longestConsecutive (line 5) | def longestConsecutive(self, nums): method longestConsecutive (line 47) | def longestConsecutive(self, nums): class Solution (line 41) | class Solution: method longestConsecutive (line 5) | def longestConsecutive(self, nums): method longestConsecutive (line 47) | def longestConsecutive(self, nums): FILE: lintcode/125_backpack_ii.py class Solution (line 4) | class Solution: method backPackII (line 11) | def backPackII(self, m, A, V): method backPackII (line 45) | def backPackII(self, m, A, V): class Solution (line 38) | class Solution: method backPackII (line 11) | def backPackII(self, m, A, V): method backPackII (line 45) | def backPackII(self, m, A, V): FILE: lintcode/126_max_tree.py class Solution (line 10) | class Solution: method maxTree (line 24) | def maxTree(self, A): FILE: lintcode/127_topological_sorting.py class Solution (line 10) | class Solution: method topSort (line 15) | def topSort(self, graph): FILE: lintcode/128_hash_function.py class Solution (line 1) | class Solution: method hashCode (line 7) | def hashCode(self, key, HASH_SIZE): FILE: lintcode/129_rehashing.py class Solution (line 11) | class Solution: method rehashing (line 16) | def rehashing(self, hash_table): FILE: lintcode/12_min_stack.py class MinStack (line 1) | class MinStack: method __init__ (line 2) | def __init__(self): method push (line 6) | def push(self, x): method pop (line 16) | def pop(self): method top (line 30) | def top(self): method min (line 39) | def min(self): FILE: lintcode/130_heapify.py class Solution (line 1) | class Solution: method heapify (line 6) | def heapify(self, A): method siftdown (line 11) | def siftdown(self, A, i): FILE: lintcode/131_building_outline.py class HashHeapq (line 8) | class HashHeapq: method __init__ (line 9) | def __init__(self): method push (line 13) | def push(self, val): method pop (line 16) | def pop(self): method remove (line 22) | def remove(self, val): method top (line 31) | def top(self): method is_empty (line 37) | def is_empty(self): class Solution (line 45) | class Solution: method buildingOutline (line 46) | def buildingOutline(self, buildings): FILE: lintcode/132_word_search_ii.py class Solution (line 1) | class Solution: method __init__ (line 2) | def __init__(self): method new_node (line 7) | def new_node(self): method put (line 13) | def put(self, parent, string): method wordSearchII (line 29) | def wordSearchII(self, board, words): method find (line 45) | def find(self, x, y, parent, result): FILE: lintcode/134_lru_cache.py class LRUCache (line 15) | class LRUCache: method __init__ (line 16) | def __init__(self, capacity): method get (line 27) | def get(self, key): method set (line 38) | def set(self, key, val): method _evict (line 56) | def _evict(self): method _update (line 60) | def _update(self, key, val=None): method _add (line 69) | def _add(self, key, val): method _pop_head (line 73) | def _pop_head(self): method _add_tail (line 78) | def _add_tail(self, node): class CacheNode (line 82) | class CacheNode: method __init__ (line 83) | def __init__(self, key, val=None, pre=None, nxt=None): method link (line 89) | def link(self, pre, nxt): method unlink (line 95) | def unlink(self): FILE: lintcode/135_combination_sum.py class Solution (line 1) | class Solution: method combinationSum (line 7) | def combinationSum(self, A, target): method dfs (line 16) | def dfs(self, A, start, remaining, ans, path): FILE: lintcode/1365_minimum_cycle_section.py class Solution (line 1) | class Solution: method minimumCycleSection (line 6) | def minimumCycleSection(self, array): FILE: lintcode/1366_directed_graph_loop.py class Solution (line 4) | class Solution: method isCyclicGraph (line 10) | def isCyclicGraph(self, start, end): method dfs (line 30) | def dfs(self, u, nxt, visited, rec_stack): FILE: lintcode/1367_police_distance.py class Solution (line 1) | class Solution: method policeDistance (line 6) | def policeDistance(self, matrix): FILE: lintcode/1368_same_number.py class Solution (line 1) | class Solution: method sameNumber (line 7) | def sameNumber(self, nums, k): FILE: lintcode/136_palindrome_partitioning.py class Solution (line 1) | class Solution: method partition (line 10) | def partition(self, s): method check_palindrome (line 20) | def check_palindrome(self, s): method dfs (line 75) | def dfs(self, s, start, palindromes): FILE: lintcode/137_clone_graph.py class Solution (line 13) | class Solution: method cloneGraph (line 14) | def cloneGraph(self, node): method cloneGraph (line 45) | def cloneGraph(self, node): method dfs (line 55) | def dfs(self, node, N): class Solution (line 44) | class Solution: method cloneGraph (line 14) | def cloneGraph(self, node): method cloneGraph (line 45) | def cloneGraph(self, node): method dfs (line 55) | def dfs(self, node, N): FILE: lintcode/138_subarray_sum.py class Solution (line 1) | class Solution: method subarraySum (line 6) | def subarraySum(self, nums): FILE: lintcode/139_subarray_sum_closest.py class Solution (line 5) | class Solution: method subarraySumClosest (line 10) | def subarraySumClosest(self, nums): FILE: lintcode/13_strstr.py class Solution (line 1) | class Solution: method strStr (line 2) | def strStr(self, haystack, needle): FILE: lintcode/141_sqrtx.py class Solution (line 1) | class Solution: method sqrt (line 2) | def sqrt(self, x): FILE: lintcode/142_o1_check_power_of_2.py class Solution (line 1) | class Solution: method checkPowerOf2 (line 6) | def checkPowerOf2(self, n): FILE: lintcode/143_sort_colors_ii.py class Solution (line 5) | class Solution: method sortColors2 (line 11) | def sortColors2(self, colors, k): method rainbow_sort (line 16) | def rainbow_sort(self, colors, start, end, color_from, color_to): method sortColors2 (line 52) | def sortColors2(self, colors, k): class Solution (line 46) | class Solution: method sortColors2 (line 11) | def sortColors2(self, colors, k): method rainbow_sort (line 16) | def rainbow_sort(self, colors, start, end, color_from, color_to): method sortColors2 (line 52) | def sortColors2(self, colors, k): FILE: lintcode/148_sort_colors.py class Solution (line 1) | class Solution: method sortColors (line 6) | def sortColors(self, A): FILE: lintcode/149_best_time_to_buy_and_sell_stock.py class Solution (line 1) | class Solution: method maxProfit (line 6) | def maxProfit(self, P): FILE: lintcode/14_first_position_of_target.py class Solution (line 1) | class Solution: method binarySearch (line 5) | def binarySearch(self, A, target): FILE: lintcode/150_best_time_to_buy_and_sell_stock_ii.py class Solution (line 1) | class Solution: method maxProfit (line 6) | def maxProfit(self, P): FILE: lintcode/151_best_time_to_buy_and_sell_stock_iii.py class Solution (line 1) | class Solution: method maxProfit (line 6) | def maxProfit(self, P): FILE: lintcode/153_combination_sum_ii.py class Solution (line 1) | class Solution: method combinationSum2 (line 7) | def combinationSum2(self, A, target): method dfs (line 16) | def dfs(self, A, start, remaining, ans, path): FILE: lintcode/154_regular_expression_matching.py class Solution (line 22) | class Solution: method isMatch (line 23) | def isMatch(self, s, p): FILE: lintcode/155_minimum_depth_of_binary_tree.py class Solution (line 10) | class Solution: method minDepth (line 15) | def minDepth(self, root): method minDepth (line 43) | def minDepth(self, root): class Solution (line 38) | class Solution: method minDepth (line 15) | def minDepth(self, root): method minDepth (line 43) | def minDepth(self, root): FILE: lintcode/156_merge_intervals.py class Solution (line 10) | class Solution: method merge (line 11) | def merge(self, intvs): FILE: lintcode/158_two_strings_are_anagrams.py class Solution (line 1) | class Solution: method anagram (line 7) | def anagram(self, s, t): FILE: lintcode/159_find_minimum_in_rotated_sorted_array.py class Solution (line 1) | class Solution: method findMin (line 6) | def findMin(self, nums): FILE: lintcode/15_permutations.py class Solution (line 1) | class Solution: method permute (line 2) | def permute(self, nums): method dfs (line 17) | def dfs(self, nums, ans, path): FILE: lintcode/160_find_minimum_in_rotated_sorted_array_ii.py class Solution (line 4) | class Solution: method findMin (line 9) | def findMin(self, A): method findMin (line 30) | def findMin(self, A): class Solution (line 25) | class Solution: method findMin (line 9) | def findMin(self, A): method findMin (line 30) | def findMin(self, A): FILE: lintcode/165_merge_two_sorted_lists.py class Solution (line 8) | class Solution: method mergeTwoLists (line 9) | def mergeTwoLists(self, a, b): FILE: lintcode/167_add_two_numbers.py class Solution (line 10) | class Solution: method addLists (line 11) | def addLists(self, A, B): FILE: lintcode/168_burst_balloons.py class Solution (line 1) | class Solution: method maxCoins (line 6) | def maxCoins(self, V): FILE: lintcode/16_permutations_ii.py class Solution (line 1) | class Solution: method permuteUnique (line 5) | def permuteUnique(self, nums): method dfs (line 21) | def dfs(self, nums, ans, path): method permuteUnique (line 45) | def permuteUnique(self, nums): method dfs (line 62) | def dfs(self, nums, visited, ans, path): class Solution (line 41) | class Solution: method permuteUnique (line 5) | def permuteUnique(self, nums): method dfs (line 21) | def dfs(self, nums, ans, path): method permuteUnique (line 45) | def permuteUnique(self, nums): method dfs (line 62) | def dfs(self, nums, visited, ans, path): FILE: lintcode/171_anagrams.py class Solution (line 1) | class Solution: method anagrams (line 6) | def anagrams(self, S): FILE: lintcode/175_invert_binary_tree.py class Solution (line 10) | class Solution: method invertBinaryTree (line 15) | def invertBinaryTree(self, root): method divide_conquer (line 18) | def divide_conquer(self, node): FILE: lintcode/178_graph_valid_tree.py class Solution (line 1) | class Solution: method validTree (line 2) | def validTree(self, n, edges): method find (line 24) | def find(self, nodes, a): FILE: lintcode/17_subsets.py class Solution (line 4) | class Solution: method subsets (line 9) | def subsets(self, A): method dfs (line 17) | def dfs(self, A, start, ans, subset): method subsets (line 35) | def subsets(self, A): class Solution (line 30) | class Solution: method subsets (line 9) | def subsets(self, A): method dfs (line 17) | def dfs(self, A, start, ans, subset): method subsets (line 35) | def subsets(self, A): FILE: lintcode/183_wood_cut.py class Solution (line 1) | class Solution: method woodCut (line 7) | def woodCut(self, L, k): method check_if_possible (line 37) | def check_if_possible(self, L, size, max_pieces): FILE: lintcode/18_subsets_ii.py class Solution (line 4) | class Solution: method subsetsWithDup (line 9) | def subsetsWithDup(self, A): method dfs (line 17) | def dfs(self, A, start, ans, subset): FILE: lintcode/190_next_permutation_ii.py class Solution (line 1) | class Solution: method nextPermutation (line 2) | def nextPermutation(self, nums): FILE: lintcode/191_maximum_product_subarray.py class Solution (line 9) | class Solution: method maxProduct (line 14) | def maxProduct(self, A): FILE: lintcode/192_wildcard_matching.py class Solution (line 23) | class Solution: method isMatch (line 24) | def isMatch(self, s, p): FILE: lintcode/196_find_the_missing_number.py class Solution (line 1) | class Solution: method findMissing (line 2) | def findMissing(self, nums): method findMissing (line 19) | def findMissing(self, nums): class Solution (line 18) | class Solution: method findMissing (line 2) | def findMissing(self, nums): method findMissing (line 19) | def findMissing(self, nums): FILE: lintcode/197_permutation_index.py class Solution (line 11) | class Solution: method permutationIndex (line 16) | def permutationIndex(self, A): FILE: lintcode/198_permutation_index_ii.py class Solution (line 10) | class Solution: method permutationIndexII (line 15) | def permutationIndexII(self, A): FILE: lintcode/1_a_b_problem.py class Solution (line 1) | class Solution: method aplusb (line 7) | def aplusb(self, a, b): FILE: lintcode/204_singleton.py class Solution (line 1) | class Solution: method getInstance (line 6) | def getInstance(cls): FILE: lintcode/211_string_permutation.py class Solution (line 1) | class Solution: method Permutation (line 7) | def Permutation(self, A, B): FILE: lintcode/215_rate_limiter.py class Solution (line 4) | class Solution: method __init__ (line 16) | def __init__(self): method isRatelimited (line 25) | def isRatelimited(self, timestamp, event, rate, increment): method check_limited (line 46) | def check_limited(self, event, freq, begin_time): FILE: lintcode/221_add_two_numbers_ii.py class Solution (line 10) | class Solution: method addLists2 (line 11) | def addLists2(self, a, b): method rev_list (line 57) | def rev_list(self, head): FILE: lintcode/231_typeahead.py class Typeahead (line 1) | class Typeahead: method __init__ (line 5) | def __init__(self, dict): method search (line 22) | def search(self, str): method __init__ (line 89) | def __init__(self, dict): method search (line 98) | def search(self, str): class Trie (line 35) | class Trie: method __init__ (line 36) | def __init__(self): method new_node (line 39) | def new_node(self): method put (line 45) | def put(self, key): method _put (line 51) | def _put(self, word, key): method search (line 59) | def search(self, key): class Typeahead (line 85) | class Typeahead: method __init__ (line 5) | def __init__(self, dict): method search (line 22) | def search(self, str): method __init__ (line 89) | def __init__(self, dict): method search (line 98) | def search(self, str): FILE: lintcode/232_tiny_url.py class TinyUrl (line 4) | class TinyUrl: method __init__ (line 5) | def __init__(self): method longToShort (line 15) | def longToShort(self, url): method shortToLong (line 33) | def shortToLong(self, url): method get_tiny_url (line 48) | def get_tiny_url(self, hash_key): method get_hash_key (line 51) | def get_hash_key(self, size): FILE: lintcode/234_webpage_crawler.py class CrawlerThread (line 8) | class CrawlerThread(Thread): method run (line 9) | def run(self): class Solution (line 26) | class Solution: method crawler (line 29) | def crawler(self, url): FILE: lintcode/236_swap_bits.py class Solution (line 1) | class Solution: method swapOddEvenBits (line 6) | def swapOddEvenBits(self, x): FILE: lintcode/242_convert_binary_tree_to_linked_lists_by_depth.py class Solution (line 16) | class Solution: method binaryTreeToLists (line 19) | def binaryTreeToLists(self, root): FILE: lintcode/245_subtree.py class Solution (line 10) | class Solution: method isSubtree (line 16) | def isSubtree(self, A, B): method isEqual (line 29) | def isEqual(self, A, B): FILE: lintcode/246_binary_tree_path_sum_ii.py class Solution (line 10) | class Solution: method binaryTreePathSum2 (line 16) | def binaryTreePathSum2(self, root, target): method dfs (line 21) | def dfs(self, node, target, ans, path): FILE: lintcode/24_lfu_cache.py class LFUCache (line 20) | class LFUCache: method __init__ (line 21) | def __init__(self, capacity): method get (line 32) | def get(self, key): method set (line 43) | def set(self, key, val): method _evict (line 61) | def _evict(self): method _update (line 69) | def _update(self, key, val=None): method _add (line 90) | def _add(self, key, val): class CacheNode (line 104) | class CacheNode: method __init__ (line 105) | def __init__(self, key, val=None, freq_node=None, pre=None, nxt=None): method unlink (line 113) | def unlink(self): class FreqNode (line 119) | class FreqNode: method __init__ (line 120) | def __init__(self, freq, pre=None, nxt=None): method unlink (line 130) | def unlink(self): method after (line 136) | def after(self, freq_node): method is_empty (line 143) | def is_empty(self): method pop_head (line 147) | def pop_head(self): method append_tail (line 156) | def append_tail(self, cache_node): FILE: lintcode/254_drop_eggs.py class Solution (line 23) | class Solution: method dropEggs (line 28) | def dropEggs(self, n): method dropEggs (line 58) | def dropEggs(self, n): class Solution (line 53) | class Solution: method dropEggs (line 28) | def dropEggs(self, n): method dropEggs (line 58) | def dropEggs(self, n): FILE: lintcode/272_climbing_stairs_ii.py class Solution (line 4) | class Solution: method climbStairs2 (line 9) | def climbStairs2(self, n): method climbStairs2 (line 30) | def climbStairs2(self, n): class Solution (line 25) | class Solution: method climbStairs2 (line 9) | def climbStairs2(self, n): method climbStairs2 (line 30) | def climbStairs2(self, n): FILE: lintcode/28_search_a_2d_matrix.py class Solution (line 1) | class Solution: method searchMatrix (line 2) | def searchMatrix(self, matrix, target): FILE: lintcode/29_interleaving_string.py class Solution (line 1) | class Solution: method isInterleave (line 8) | def isInterleave(self, A, B, C): FILE: lintcode/30_insert_interval.py class Solution (line 18) | class Solution: method insert (line 19) | def insert(self, intvs, intv): FILE: lintcode/31_partition_array.py class Solution (line 1) | class Solution: method partitionArray (line 7) | def partitionArray(self, A, k): FILE: lintcode/32_minimum_window_substring.py class Solution (line 1) | class Solution: method minWindow (line 2) | def minWindow(self, s, t): FILE: lintcode/35_reverse_linked_list.py class Solution (line 12) | class Solution: method reverse (line 17) | def reverse(self, head): FILE: lintcode/360_sliding_window_median.py class HashHeapqWithLazy (line 4) | class HashHeapqWithLazy: method __init__ (line 5) | def __init__(self): method __len__ (line 10) | def __len__(self): method __bool__ (line 13) | def __bool__(self): method push (line 16) | def push(self, val): method pop (line 20) | def pop(self): method remove (line 27) | def remove(self, val): method top (line 34) | def top(self): method _is_empty (line 40) | def _is_empty(self): class Solution (line 48) | class Solution: method medianSlidingWindow (line 49) | def medianSlidingWindow(self, nums, k): method get_median (line 83) | def get_median(self): FILE: lintcode/362_sliding_window_maximum.py class HashHeapq (line 4) | class HashHeapq: method __init__ (line 5) | def __init__(self): method push (line 9) | def push(self, val): method pop (line 12) | def pop(self): method remove (line 17) | def remove(self, val): method top (line 22) | def top(self): method is_empty (line 27) | def is_empty(self): class Solution (line 34) | class Solution: method maxSlidingWindow (line 35) | def maxSlidingWindow(self, A, k): method maxSlidingWindow (line 66) | def maxSlidingWindow(self, A, k): class Solution (line 60) | class Solution: method maxSlidingWindow (line 35) | def maxSlidingWindow(self, A, k): method maxSlidingWindow (line 66) | def maxSlidingWindow(self, A, k): FILE: lintcode/363_trapping_rain_water.py class Solution (line 1) | class Solution: method trapRainWater (line 6) | def trapRainWater(self, heights): FILE: lintcode/364_trapping_rain_water_ii.py class Solution (line 3) | class Solution: method trapRainWater (line 8) | def trapRainWater(self, heights): FILE: lintcode/368_expression_evaluation.py class Solution (line 7) | class Solution: method evaluateExpression (line 19) | def evaluateExpression(self, E): method dal2rpn (line 33) | def dal2rpn(self, E): method eval_rpn (line 80) | def eval_rpn(self, E): FILE: lintcode/36_reverse_linked_list_ii.py class Solution (line 11) | class Solution: method reverseBetween (line 18) | def reverseBetween(self, head, m, n): FILE: lintcode/376_binary_tree_path_sum.py class Solution (line 10) | class Solution: method binaryTreePathSum (line 16) | def binaryTreePathSum(self, root, target): method dfs (line 21) | def dfs(self, node, remaining, ans, path): FILE: lintcode/378_convert_binary_search_tree_to_doubly_linked_list.py class Solution (line 16) | class Solution: method bstToDoublyList (line 21) | def bstToDoublyList(self, root): FILE: lintcode/382_triangle_count.py class Solution (line 1) | class Solution: method triangleCount (line 6) | def triangleCount(self, S): FILE: lintcode/384_longest_substring_without_repeating_characters.py class Solution (line 4) | class Solution: method lengthOfLongestSubstring (line 5) | def lengthOfLongestSubstring(self, s): FILE: lintcode/386_longest_substring_with_at_most_k_distinct_characters.py class Solution (line 4) | class Solution: method lengthOfLongestSubstringKDistinct (line 5) | def lengthOfLongestSubstringKDistinct(self, s, k): FILE: lintcode/38_search_a_2d_matrix_ii.py class Solution (line 7) | class Solution: method searchMatrix (line 8) | def searchMatrix(self, matrix, target): method searchMatrix (line 50) | def searchMatrix(self, matrix, target): class Solution (line 49) | class Solution: method searchMatrix (line 8) | def searchMatrix(self, matrix, target): method searchMatrix (line 50) | def searchMatrix(self, matrix, target): FILE: lintcode/390_find_peak_element_ii.py class Solution (line 17) | class Solution: method findPeakII (line 36) | def findPeakII(self, A): method findColMax (line 70) | def findColMax(self, A, col, up, down): method findRowMax (line 78) | def findRowMax(self, A, row, left, right): method isPeak (line 85) | def isPeak(self, A, row, col): FILE: lintcode/391_number_of_airplanes_in_the_sky.py class Solution (line 10) | class Solution: method countOfAirplanes (line 15) | def countOfAirplanes(self, airplanes): FILE: lintcode/392_house_robber.py class Solution (line 5) | class Solution: method houseRobber (line 10) | def houseRobber(self, A): method houseRobber (line 34) | def houseRobber(self, A): method houseRobber (line 66) | def houseRobber(self, A): class Solution (line 29) | class Solution: method houseRobber (line 10) | def houseRobber(self, A): method houseRobber (line 34) | def houseRobber(self, A): method houseRobber (line 66) | def houseRobber(self, A): class Solution (line 65) | class Solution: method houseRobber (line 10) | def houseRobber(self, A): method houseRobber (line 34) | def houseRobber(self, A): method houseRobber (line 66) | def houseRobber(self, A): FILE: lintcode/393_best_time_to_buy_and_sell_stock_iv.py class Solution (line 1) | class Solution: method maxProfit (line 7) | def maxProfit(self, K, P): FILE: lintcode/394_coins_in_a_line.py class Solution (line 25) | class Solution: method firstWillWin (line 26) | def firstWillWin(self, n): FILE: lintcode/395_coins_in_a_line_ii.py class Solution (line 18) | class Solution: method firstWillWin (line 19) | def firstWillWin(self, values): FILE: lintcode/396_coins_in_a_line_iii.py class Solution (line 28) | class Solution: method firstWillWin (line 29) | def firstWillWin(self, values): FILE: lintcode/397_longest_increasing_continuous_subsequence.py class Solution (line 5) | class Solution: method longestIncreasingContinuousSubsequence (line 10) | def longestIncreasingContinuousSubsequence(self, A): method get_lics_size (line 20) | def get_lics_size(self, A): method longestIncreasingContinuousSubsequence (line 58) | def longestIncreasingContinuousSubsequence(self, A): method get_lics_size (line 68) | def get_lics_size(self, A): class Solution (line 53) | class Solution: method longestIncreasingContinuousSubsequence (line 10) | def longestIncreasingContinuousSubsequence(self, A): method get_lics_size (line 20) | def get_lics_size(self, A): method longestIncreasingContinuousSubsequence (line 58) | def longestIncreasingContinuousSubsequence(self, A): method get_lics_size (line 68) | def get_lics_size(self, A): FILE: lintcode/3_digit_counts.py class Solution (line 1) | class Solution: method digitCounts (line 7) | def digitCounts(self, k, n): method count (line 13) | def count(self, k, a): FILE: lintcode/401_kth_smallest_number_in_sorted_matrix.py class Solution (line 3) | class Solution: method kthSmallest (line 9) | def kthSmallest(self, matrix, k): FILE: lintcode/402_continuous_subarray_sum.py class Solution (line 1) | class Solution: method continuousSubarraySum (line 6) | def continuousSubarraySum(self, A): FILE: lintcode/406_minimum_size_subarray_sum.py class Solution (line 1) | class Solution: method minimumSize (line 7) | def minimumSize(self, nums, s): FILE: lintcode/40_implement_queue_by_two_stacks.py class MyQueue (line 1) | class MyQueue: method __init__ (line 2) | def __init__(self, ): method push (line 10) | def push(self, element): method pop (line 16) | def pop(self, ): method top (line 23) | def top(self, ): FILE: lintcode/414_divide_two_integers.py class Solution (line 1) | class Solution: method divide (line 2) | def divide(self, a, b): FILE: lintcode/415_valid_palindrome.py class Solution (line 1) | class Solution: method isPalindrome (line 2) | def isPalindrome(self, s): FILE: lintcode/417_valid_number.py class Solution (line 1) | class Solution: method isNumber (line 6) | def isNumber(self, s): FILE: lintcode/418_integer_to_roman.py class Solution (line 1) | class Solution: method intToRoman (line 2) | def intToRoman(self, num): FILE: lintcode/419_roman_to_integer.py class Solution (line 1) | class Solution: method romanToInt (line 2) | def romanToInt(self, s): FILE: lintcode/41_maximum_subarray.py class Solution (line 4) | class Solution: method maxSubArray (line 9) | def maxSubArray(self, A): method maxSubArray (line 43) | def maxSubArray(self, A): class Solution (line 38) | class Solution: method maxSubArray (line 9) | def maxSubArray(self, A): method maxSubArray (line 43) | def maxSubArray(self, A): FILE: lintcode/42_maximum_subarray_ii.py class Solution (line 16) | class Solution: method maxTwoSubArrays (line 17) | def maxTwoSubArrays(self, nums): method get_max_sums (line 40) | def get_max_sums(self, nums, num_range): FILE: lintcode/430_scramble_string.py class Solution (line 1) | class Solution: method isScramble (line 7) | def isScramble(self, s1, s2): FILE: lintcode/431_connected_component_in_undirected_graph.py class Solution (line 10) | class Solution: method connectedSet (line 14) | def connectedSet(self, nodes): method union (line 41) | def union(self, nodes, a, b): method find (line 48) | def find(self, nodes, a): method connectedSet (line 63) | def connectedSet(self, nodes): method dfs (line 85) | def dfs(self, a, visited, path): class Solution (line 59) | class Solution: method connectedSet (line 14) | def connectedSet(self, nodes): method union (line 41) | def union(self, nodes, a, b): method find (line 48) | def find(self, nodes, a): method connectedSet (line 63) | def connectedSet(self, nodes): method dfs (line 85) | def dfs(self, a, visited, path): FILE: lintcode/432_find_the_weak_connected_component_in_the_directed_graph.py class Solution (line 10) | class Solution: method __init__ (line 11) | def __init__(self): method connectedSet2 (line 18) | def connectedSet2(self, nodes): method connect (line 34) | def connect(self, a, b): method find (line 40) | def find(self, a): FILE: lintcode/433_number_of_islands.py class Solution (line 1) | class Solution: method numIslands (line 2) | def numIslands(self, grid): method dfs (line 22) | def dfs(self, grid, x, y): FILE: lintcode/434_number_of_islands_ii.py class Solution (line 10) | class Solution: method numIslands2 (line 11) | def numIslands2(self, m, n, operators): method union (line 54) | def union(self, nodes, a, b): method find (line 64) | def find(self, nodes, a): FILE: lintcode/437_copy_books.py class Solution (line 4) | class Solution: method copyBooks (line 10) | def copyBooks(self, P, k): method copyBooks (line 69) | def copyBooks(self, P, k): method copyBooks (line 146) | def copyBooks(self, P, k): method check_if_possible (line 175) | def check_if_possible(self, P, spent_time, max_copiers): class Solution (line 63) | class Solution: method copyBooks (line 10) | def copyBooks(self, P, k): method copyBooks (line 69) | def copyBooks(self, P, k): method copyBooks (line 146) | def copyBooks(self, P, k): method check_if_possible (line 175) | def check_if_possible(self, P, spent_time, max_copiers): class Solution (line 140) | class Solution: method copyBooks (line 10) | def copyBooks(self, P, k): method copyBooks (line 69) | def copyBooks(self, P, k): method copyBooks (line 146) | def copyBooks(self, P, k): method check_if_possible (line 175) | def check_if_possible(self, P, spent_time, max_copiers): FILE: lintcode/43_maximum_subarray_iii.py class Solution (line 6) | class Solution: method maxSubArray (line 12) | def maxSubArray(self, A, k): FILE: lintcode/440_backpack_iii.py class Solution (line 4) | class Solution: method backPackIII (line 11) | def backPackIII(self, A, V, m): method backPackIII (line 39) | def backPackIII(self, A, V, m): class Solution (line 32) | class Solution: method backPackIII (line 11) | def backPackIII(self, A, V, m): method backPackIII (line 39) | def backPackIII(self, A, V, m): FILE: lintcode/442_implement_trie.py class TrieNode (line 1) | class TrieNode: method __init__ (line 2) | def __init__(self): class Trie (line 7) | class Trie: method __init__ (line 8) | def __init__(self): method insert (line 15) | def insert(self, word): method search (line 33) | def search(self, word): method startsWith (line 51) | def startsWith(self, prefix): FILE: lintcode/443_two_sum_greater_than_target.py class Solution (line 1) | class Solution: method twoSum2 (line 7) | def twoSum2(self, A, target): FILE: lintcode/447_search_in_a_big_sorted_array.py class Solution (line 14) | class Solution: method searchBigSortedArray (line 20) | def searchBigSortedArray(self, reader, target): FILE: lintcode/450_reverse_nodes_in_k_group.py class Solution (line 10) | class Solution: method reverseKGroup (line 16) | def reverseKGroup(self, head, k): method find_kth (line 29) | def find_kth(self, head, k): method reverse (line 36) | def reverse(self, head): method reverse_next_kth (line 45) | def reverse_next_kth(self, head, k): FILE: lintcode/453_flatten_binary_tree_to_linked_list.py class Solution (line 32) | class Solution: method flatten (line 37) | def flatten(self, root): FILE: lintcode/457_classical_binary_search.py class Solution (line 1) | class Solution: method findPosition (line 7) | def findPosition(self, A, target): FILE: lintcode/458_last_position_of_target.py class Solution (line 1) | class Solution: method lastPosition (line 7) | def lastPosition(self, nums, target): FILE: lintcode/459_closest_number_in_sorted_array.py class Solution (line 1) | class Solution: method closestNumber (line 7) | def closestNumber(self, A, target): FILE: lintcode/45_maximum_subarray_difference.py class Solution (line 1) | class Solution: method maxDiffSubArrays (line 6) | def maxDiffSubArrays(self, A): method get_sum (line 27) | def get_sum(self, A, scope, factor): FILE: lintcode/460_k_closest_numbers_in_sorted_array.py class Solution (line 1) | class Solution: method kClosestNumbers (line 8) | def kClosestNumbers(self, A, target, k): FILE: lintcode/461_kth_smallest_numbers_in_unsorted_array.py class Solution (line 1) | class Solution: method kthSmallest (line 7) | def kthSmallest(self, K, A): method quick_select (line 13) | def quick_select(self, k, A, start, end): FILE: lintcode/462_total_occurrence_of_target.py class Solution (line 1) | class Solution: method totalOccurrence (line 2) | def totalOccurrence(self, A, target): FILE: lintcode/465_kth_smallest_sum_in_two_sorted_arrays.py class Solution (line 17) | class Solution: method kthSmallestSum (line 25) | def kthSmallestSum(self, A, B, k): FILE: lintcode/469_identical_binary_tree.py class Solution (line 10) | class Solution: method isIdentical (line 16) | def isIdentical(self, A, B): FILE: lintcode/471_top_k_frequent_words.py class Solution (line 1) | class Solution: method topKFrequentWords (line 7) | def topKFrequentWords(self, words, k): FILE: lintcode/472_binary_tree_path_sum_iii.py class Solution (line 10) | class Solution: method binaryTreePathSum3 (line 16) | def binaryTreePathSum3(self, root, target): method dfs (line 26) | def dfs(self, node, target, ans): method find_path (line 35) | def find_path(self, node, start, remaining, ans, path): FILE: lintcode/473_add_and_search_word.py class Trie (line 1) | class Trie: method __init__ (line 2) | def __init__(self): method insert (line 5) | def insert(self, string): method search (line 17) | def search(self, string): method search_in_regex (line 28) | def search_in_regex(self, string): method _search_in_regex (line 33) | def _search_in_regex(self, string, parent, i): class WordDictionary (line 46) | class WordDictionary: method __init__ (line 47) | def __init__(self): method addWord (line 54) | def addWord(self, word): method search (line 63) | def search(self, word): FILE: lintcode/474_lowest_common_ancestor_ii.py class Solution (line 14) | class Solution: method lowestCommonAncestorII (line 15) | def lowestCommonAncestorII(self, root, a, b): FILE: lintcode/475_binary_tree_maximum_path_sum_ii.py class Solution (line 10) | class Solution: method maxPathSum2 (line 11) | def maxPathSum2(self, root): FILE: lintcode/479_second_max_of_array.py class Solution (line 1) | class Solution: method secondMax (line 6) | def secondMax(self, A): FILE: lintcode/480_binary_tree_paths.py class Solution (line 10) | class Solution: method binaryTreePaths (line 11) | def binaryTreePaths(self, root): method dfs (line 24) | def dfs(self, node, ans, path): FILE: lintcode/486_merge_k_sorted_arrays.py class Solution (line 4) | class Solution: method mergekSortedArrays (line 9) | def mergekSortedArrays(self, G): FILE: lintcode/494_implement_stack_by_two_queues.py class Stack (line 4) | class Stack: method __init__ (line 5) | def __init__(self): method push (line 12) | def push(self, x): method pop (line 21) | def pop(self): method top (line 31) | def top(self): method isEmpty (line 39) | def isEmpty(self): FILE: lintcode/496_toy_factory.py class Toy (line 7) | class Toy: method talk (line 8) | def talk(self): class Dog (line 12) | class Dog(Toy): method talk (line 13) | def talk(self): class Cat (line 17) | class Cat(Toy): method talk (line 18) | def talk(self): class ToyFactory (line 22) | class ToyFactory: method getToy (line 25) | def getToy(self, type): FILE: lintcode/497_shape_factory.py class Shape (line 7) | class Shape: method draw (line 8) | def draw(self): class Triangle (line 12) | class Triangle(Shape): method draw (line 13) | def draw(self): class Rectangle (line 19) | class Rectangle(Shape): method draw (line 20) | def draw(self): class Square (line 26) | class Square(Shape): method draw (line 27) | def draw(self): class ShapeFactory (line 34) | class ShapeFactory: method getShape (line 37) | def getShape(self, shapeType): FILE: lintcode/498_parking_lot.py class Vehicle (line 8) | class Vehicle: method __init__ (line 9) | def __init__(self): method unpark (line 15) | def unpark(self): class Motorcycle (line 26) | class Motorcycle(Vehicle): method __init__ (line 27) | def __init__(self): class Car (line 32) | class Car(Vehicle): method __init__ (line 33) | def __init__(self): class Bus (line 38) | class Bus(Vehicle): method __init__ (line 39) | def __init__(self): class Level (line 44) | class Level: method __init__ (line 45) | def __init__(self, id, m, n): method get_range (line 51) | def get_range(self, vehicle_type): method park_vehicle (line 62) | def park_vehicle(self, vehicle): class ParkingLot (line 93) | class ParkingLot: method __init__ (line 94) | def __init__(self, k, m, n): method park_vehicle (line 102) | def park_vehicle(self, vehicle): method unpark_vehicle (line 115) | def unpark_vehicle(self, vehicle): FILE: lintcode/499_word_count.py class WordCount (line 1) | class WordCount: method mapper (line 4) | def mapper(self, _, line): method reducer (line 10) | def reducer(self, key, values): FILE: lintcode/4_ugly_number_ii.py class Solution (line 11) | class Solution: method nthUglyNumber (line 12) | def nthUglyNumber(self, n): FILE: lintcode/500_inverted_index.py class Solution (line 8) | class Solution: method invertedIndex (line 11) | def invertedIndex(self, docs): FILE: lintcode/501_mini_twitter.py class MiniTwitter (line 11) | class MiniTwitter: method __init__ (line 12) | def __init__(self): method postTweet (line 22) | def postTweet(self, user_id, tweet_text): method getNewsFeed (line 38) | def getNewsFeed(self, user_id): method getTimeline (line 59) | def getTimeline(self, user_id): method follow (line 70) | def follow(self, from_id, to_id): method unfollow (line 84) | def unfollow(self, from_id, to_id): FILE: lintcode/502_mini_cassandra.py class MiniCassandra (line 10) | class MiniCassandra: method insert (line 20) | def insert(self, raw_key, column_key, column_value): method query (line 32) | def query(self, raw_key, column_start, column_end): FILE: lintcode/503_anagram_map_reduce.py class Anagram (line 1) | class Anagram: method mapper (line 4) | def mapper(self, _, line): method reducer (line 10) | def reducer(self, key, values): FILE: lintcode/504_inverted_index_map_reduce.py class InvertedIndex (line 8) | class InvertedIndex: method mapper (line 11) | def mapper(self, _, value): method reducer (line 17) | def reducer(self, key, values): FILE: lintcode/505_web_logger.py class WebLogger (line 1) | class WebLogger: method __init__ (line 2) | def __init__(self): method hit (line 12) | def hit(self, timestamp): method get_hit_count_in_last_5_minutes (line 25) | def get_hit_count_in_last_5_minutes(self, timestamp): FILE: lintcode/509_mini_yelp.py class MiniYelp (line 67) | class MiniYelp: method add_restaurant (line 82) | def add_restaurant(self, name, location): method remove_restaurant (line 94) | def remove_restaurant(self, restaurant_id): method neighbors (line 106) | def neighbors(self, location, k): method get_length (line 129) | def get_length(self, k): method get_restr_hashcode (line 138) | def get_restr_hashcode(self, restaurant): method add_restaurant (line 216) | def add_restaurant(self, name, location): method remove_restaurant (line 228) | def remove_restaurant(self, restaurant_id): method neighbors (line 239) | def neighbors(self, location, k): method get_length (line 258) | def get_length(self, k): method get_restr_hashcode (line 267) | def get_restr_hashcode(self, restaurant): class Trie (line 151) | class Trie: method __init__ (line 152) | def __init__(self): method __repr__ (line 155) | def __repr__(self): method put (line 158) | def put(self, key): method pick (line 170) | def pick(self, key): method get_keys_by_prefix (line 182) | def get_keys_by_prefix(self, prefix): method _new_node (line 194) | def _new_node(self): class MiniYelp (line 201) | class MiniYelp: method add_restaurant (line 82) | def add_restaurant(self, name, location): method remove_restaurant (line 94) | def remove_restaurant(self, restaurant_id): method neighbors (line 106) | def neighbors(self, location, k): method get_length (line 129) | def get_length(self, k): method get_restr_hashcode (line 138) | def get_restr_hashcode(self, restaurant): method add_restaurant (line 216) | def add_restaurant(self, name, location): method remove_restaurant (line 228) | def remove_restaurant(self, restaurant_id): method neighbors (line 239) | def neighbors(self, location, k): method get_length (line 258) | def get_length(self, k): method get_restr_hashcode (line 267) | def get_restr_hashcode(self, restaurant): FILE: lintcode/510_maximal_rectangle.py class Solution (line 1) | class Solution: method maximalRectangle (line 2) | def maximalRectangle(self, G): method maximalRectangle (line 90) | def maximalRectangle(self, G): method largestRectangleArea (line 116) | def largestRectangleArea(self, H): class Solution (line 89) | class Solution: method maximalRectangle (line 2) | def maximalRectangle(self, G): method maximalRectangle (line 90) | def maximalRectangle(self, G): method largestRectangleArea (line 116) | def largestRectangleArea(self, H): FILE: lintcode/512_decode_ways.py class Solution (line 1) | class Solution: method numDecodings (line 6) | def numDecodings(self, s): FILE: lintcode/513_perfect_squares.py class Solution (line 8) | class Solution: method numSquares (line 13) | def numSquares(self, n): FILE: lintcode/515_paint_house.py class Solution (line 1) | class Solution: method minCost (line 6) | def minCost(self, costs): FILE: lintcode/516_paint_house_ii.py class Solution (line 19) | class Solution: method minCostII (line 24) | def minCostII(self, C): FILE: lintcode/517_ugly_number.py class Solution (line 1) | class Solution: method isUgly (line 2) | def isUgly(self, num): FILE: lintcode/518_super_ugly_number.py class Solution (line 1) | class Solution: method nthSuperUglyNumber (line 2) | def nthSuperUglyNumber(self, n, primes): FILE: lintcode/519_consistent_hashing.py class Solution (line 1) | class Solution: method consistentHashing (line 6) | def consistentHashing(self, n): FILE: lintcode/51_previous_permutation.py class Solution (line 15) | class Solution: method previousPermuation (line 16) | def previousPermuation(self, nums): FILE: lintcode/520_consistent_hashing_ii.py class Solution (line 4) | class Solution: method create (line 11) | def create(cls, n, k): method addMachine (line 23) | def addMachine(self, machine_id): method getMachineIdByHashCode (line 39) | def getMachineIdByHashCode(self, hashcode): FILE: lintcode/521_remove_duplicate_numbers_in_array.py class Solution (line 5) | class Solution: method deduplication (line 10) | def deduplication(self, nums): method deduplication (line 33) | def deduplication(self, nums): class Solution (line 28) | class Solution: method deduplication (line 10) | def deduplication(self, nums): method deduplication (line 33) | def deduplication(self, nums): FILE: lintcode/522_tiny_url_ii.py class TinyUrl2 (line 4) | class TinyUrl2: method __init__ (line 5) | def __init__(self): method createCustom (line 18) | def createCustom(self, url, key): method longToShort (line 43) | def longToShort(self, url): method shortToLong (line 63) | def shortToLong(self, url): method get_tiny_url (line 80) | def get_tiny_url(self, hash_key): method get_hash_key (line 83) | def get_hash_key(self, size): FILE: lintcode/523_url_parser.py class HtmlParser (line 3) | class HtmlParser: method parseUrls (line 8) | def parseUrls(self, content): FILE: lintcode/525_mini_uber.py class MiniUber (line 18) | class MiniUber: method report (line 27) | def report(self, driver_id, lat, lng): method request (line 43) | def request(self, rider_id, lat, lng): method _new_location (line 65) | def _new_location(self, lat, lng): FILE: lintcode/526_load_balancer.py class LoadBalancer (line 4) | class LoadBalancer: method __init__ (line 5) | def __init__(self): method add (line 13) | def add(self, server_id): method remove (line 21) | def remove(self, server_id): method pick (line 37) | def pick(self): FILE: lintcode/527_trie_serialization.py class Solution (line 10) | class Solution: method serialize (line 32) | def serialize(self, root): method deserialize (line 48) | def deserialize(self, data): FILE: lintcode/528_flatten_nested_list_iterator.py class NestedIterator (line 27) | class NestedIterator(object): method __init__ (line 28) | def __init__(self, nestedList): method next (line 32) | def next(self): method hasNext (line 42) | def hasNext(self): FILE: lintcode/529_geohash.py class GeoHash (line 6) | class GeoHash: method encode (line 15) | def encode(self, latitude, longitude, precision=5): method _loc_to_bins (line 35) | def _loc_to_bins(self, location, times, left, right): method get_base32_list (line 50) | def get_base32_list(self): FILE: lintcode/52_next_permutation.py class Solution (line 15) | class Solution: method nextPermutation (line 16) | def nextPermutation(self, nums): FILE: lintcode/530_geohash_ii.py class GeoHash (line 6) | class GeoHash: method decode (line 13) | def decode(self, geohash): method _bins_to_loc (line 34) | def _bins_to_loc(self, bins, left, right): method _oct_to_bins (line 46) | def _oct_to_bins(self, val_in_oct): method get_base32_list (line 57) | def get_base32_list(self): FILE: lintcode/531_six_degrees.py class Solution (line 10) | class Solution: method sixDegrees (line 17) | def sixDegrees(self, graph, s, t): FILE: lintcode/532_reverse_pairs.py class Solution (line 1) | class Solution: method reversePairs (line 6) | def reversePairs(self, A): method merge_sort (line 11) | def merge_sort(self, A, start, end, tmp): FILE: lintcode/533_two_sum_closest_to_target.py class Solution (line 1) | class Solution: method twoSumClosest (line 7) | def twoSumClosest(self, nums, target): FILE: lintcode/534_house_robber_ii.py class Solution (line 28) | class Solution: method houseRobber2 (line 33) | def houseRobber2(self, A): method houseRobber (line 46) | def houseRobber(self, A, start, dp): method houseRobber2 (line 67) | def houseRobber2(self, A): method houseRobber (line 86) | def houseRobber(self, A, start, dp): method houseRobber2 (line 102) | def houseRobber2(self, A): method rob_in_line (line 118) | def rob_in_line(self, A, start, end): class Solution (line 62) | class Solution: method houseRobber2 (line 33) | def houseRobber2(self, A): method houseRobber (line 46) | def houseRobber(self, A, start, dp): method houseRobber2 (line 67) | def houseRobber2(self, A): method houseRobber (line 86) | def houseRobber(self, A, start, dp): method houseRobber2 (line 102) | def houseRobber2(self, A): method rob_in_line (line 118) | def rob_in_line(self, A, start, end): class Solution (line 101) | class Solution: method houseRobber2 (line 33) | def houseRobber2(self, A): method houseRobber (line 46) | def houseRobber(self, A, start, dp): method houseRobber2 (line 67) | def houseRobber2(self, A): method houseRobber (line 86) | def houseRobber(self, A, start, dp): method houseRobber2 (line 102) | def houseRobber2(self, A): method rob_in_line (line 118) | def rob_in_line(self, A, start, end): FILE: lintcode/538_memcache.py class Memcache (line 1) | class Memcache: method get (line 12) | def get(self, curtTime, key): method set (line 29) | def set(self, curtTime, key, value, ttl): method delete (line 40) | def delete(self, curtTime, key): method incr (line 50) | def incr(self, curtTime, key, delta): method decr (line 67) | def decr(self, curtTime, key, delta): method _new_item (line 70) | def _new_item(self, key, value, expired_at): FILE: lintcode/539_move_zeroes.py class Solution (line 1) | class Solution: method moveZeroes (line 2) | def moveZeroes(self, nums): FILE: lintcode/53_reverse_words_in_a_string.py class Solution (line 1) | class Solution: method reverseWords (line 6) | def reverseWords(self, s): FILE: lintcode/540_zigzag_iterator.py class ZigzagIterator (line 9) | class ZigzagIterator: method __init__ (line 14) | def __init__(self, v1, v2): method next (line 23) | def next(self): method hasNext (line 37) | def hasNext(self): method __init__ (line 60) | def __init__(self, v1, v2): method next (line 66) | def next(self): method hasNext (line 81) | def hasNext(self): class ZigzagIterator (line 55) | class ZigzagIterator: method __init__ (line 14) | def __init__(self, v1, v2): method next (line 23) | def next(self): method hasNext (line 37) | def hasNext(self): method __init__ (line 60) | def __init__(self, v1, v2): method next (line 66) | def next(self): method hasNext (line 81) | def hasNext(self): FILE: lintcode/541_zigzag_iterator_ii.py class ZigzagIterator2 (line 9) | class ZigzagIterator2: method __init__ (line 13) | def __init__(self, vecs): method next (line 22) | def next(self): method hasNext (line 36) | def hasNext(self): method __init__ (line 58) | def __init__(self, vecs): method next (line 64) | def next(self): method hasNext (line 79) | def hasNext(self): class ZigzagIterator2 (line 54) | class ZigzagIterator2: method __init__ (line 13) | def __init__(self, vecs): method next (line 22) | def next(self): method hasNext (line 36) | def hasNext(self): method __init__ (line 58) | def __init__(self, vecs): method next (line 64) | def next(self): method hasNext (line 79) | def hasNext(self): FILE: lintcode/543_kth_largest_in_n_arrays.py class Solution (line 3) | class Solution: method KthInArrays (line 10) | def KthInArrays(self, arrays, k): FILE: lintcode/544_top_k_largest_numbers.py class Solution (line 4) | class Solution: method topk (line 10) | def topk(self, nums, k): FILE: lintcode/545_top_k_largest_numbers_ii.py class Solution (line 4) | class Solution: method __init__ (line 8) | def __init__(self, k): method add (line 16) | def add(self, num): method topk (line 27) | def topk(self): FILE: lintcode/547_intersection_of_two_arrays.py class Solution (line 1) | class Solution: method intersection (line 2) | def intersection(self, a, b): method intersection (line 24) | def intersection(self, a, b): class Solution (line 23) | class Solution: method intersection (line 2) | def intersection(self, a, b): method intersection (line 24) | def intersection(self, a, b): FILE: lintcode/548_intersection_of_two_arrays_ii.py class Solution (line 1) | class Solution: method intersect (line 2) | def intersect(self, a, b): method intersect (line 29) | def intersect(self, a, b): class Solution (line 28) | class Solution: method intersect (line 2) | def intersect(self, a, b): method intersect (line 29) | def intersect(self, a, b): FILE: lintcode/54_string_to_integer_ii.py class Solution (line 1) | class Solution: method atoi (line 6) | def atoi(self, s): FILE: lintcode/551_nested_list_weight_sum.py class Solution (line 22) | class Solution(object): method depthSum (line 25) | def depthSum(self, L): method dfs (line 28) | def dfs(self, L, depth): method depthSum (line 44) | def depthSum(self, L): class Solution (line 41) | class Solution(object): method depthSum (line 25) | def depthSum(self, L): method dfs (line 28) | def dfs(self, L, depth): method depthSum (line 44) | def depthSum(self, L): FILE: lintcode/552_create_maximum_number.py class Solution (line 1) | class Solution: method maxNumber (line 2) | def maxNumber(self, a, b, k): method get_max (line 23) | def get_max(self, a, size): method merge (line 40) | def merge(self, a, b): FILE: lintcode/553_bomb_enemy.py class Solution (line 28) | class Solution: method maxKilledEnemies (line 33) | def maxKilledEnemies(self, grid): method maxKilledEnemies (line 82) | def maxKilledEnemies(self, grid): method get_killed_cnt (line 101) | def get_killed_cnt(self, grid, i, j): class Solution (line 77) | class Solution: method maxKilledEnemies (line 33) | def maxKilledEnemies(self, grid): method maxKilledEnemies (line 82) | def maxKilledEnemies(self, grid): method get_killed_cnt (line 101) | def get_killed_cnt(self, grid, i, j): FILE: lintcode/555_counting_bloom_filter.py class HashFunc (line 4) | class HashFunc: method __init__ (line 5) | def __init__(self, cap, seed): method hash (line 9) | def hash(self, key): class CountingBloomFilter (line 20) | class CountingBloomFilter: method __init__ (line 21) | def __init__(self, k): method add (line 36) | def add(self, word): method remove (line 45) | def remove(self, word): method contains (line 54) | def contains(self, word): FILE: lintcode/556_standard_bloom_filter.py class HashFunc (line 4) | class HashFunc: method __init__ (line 5) | def __init__(self, cap, seed): method hash (line 9) | def hash(self, key): class StandardBloomFilter (line 20) | class StandardBloomFilter: method __init__ (line 21) | def __init__(self, k): method add (line 36) | def add(self, word): method contains (line 45) | def contains(self, word): FILE: lintcode/559_trie_service.py class TrieService (line 9) | class TrieService: method __init__ (line 11) | def __init__(self): method get_root (line 14) | def get_root(self): method insert (line 22) | def insert(self, word, frequency): FILE: lintcode/560_friendship_service.py class FriendshipService (line 1) | class FriendshipService: method __init__ (line 2) | def __init__(self): method getFollowers (line 6) | def getFollowers(self, user_id): method getFollowings (line 9) | def getFollowings(self, user_id): method get_followers (line 16) | def get_followers(self, user_id): method get_followings (line 26) | def get_followings(self, user_id): method follow (line 37) | def follow(self, to_id, from_id): method unfollow (line 51) | def unfollow(self, to_id, from_id): FILE: lintcode/563_backpack_v.py class Solution (line 4) | class Solution: method backPackV (line 10) | def backPackV(self, A, target): method backPackV (line 36) | def backPackV(self, A, target): class Solution (line 30) | class Solution: method backPackV (line 10) | def backPackV(self, A, target): method backPackV (line 36) | def backPackV(self, A, target): FILE: lintcode/564_backpack_vi.py class Solution (line 1) | class Solution: method backPackVI (line 7) | def backPackVI(self, A, target): FILE: lintcode/565_heart_beat.py class HeartBeat (line 1) | class HeartBeat: method __init__ (line 3) | def __init__(self): method initialize (line 11) | def initialize(self, slaves_ip_list, k): method ping (line 20) | def ping(self, timestamp, slave_ip): method getDiedSlaves (line 28) | def getDiedSlaves(self, timestamp): FILE: lintcode/566_gfs_client.py class GFSClient (line 11) | class GFSClient(BaseGFSClient): method __init__ (line 15) | def __init__(self, chunkSize): method read (line 24) | def read(self, filename): method write (line 38) | def write(self, filename, content): FILE: lintcode/56_two_sum.py class Solution (line 7) | class Solution: method twoSum (line 13) | def twoSum(self, A, target): method twoSum (line 43) | def twoSum(self, A, target): class Solution (line 37) | class Solution: method twoSum (line 13) | def twoSum(self, A, target): method twoSum (line 43) | def twoSum(self, A, target): FILE: lintcode/573_build_post_office_ii.py class Solution (line 11) | class Solution: method shortestDistance (line 25) | def shortestDistance(self, grid): method bfs (line 52) | def bfs(self, grid, x, y, times, steps): method shortestDistance (line 100) | def shortestDistance(self, grid): method dfs (line 130) | def dfs(self, grid, x, y, id, ids, steps, step): class Solution (line 88) | class Solution: method shortestDistance (line 25) | def shortestDistance(self, grid): method bfs (line 52) | def bfs(self, grid, x, y, times, steps): method shortestDistance (line 100) | def shortestDistance(self, grid): method dfs (line 130) | def dfs(self, grid, x, y, id, ids, steps, step): FILE: lintcode/574_build_post_office.py class Solution (line 8) | class Solution: method shortestDistance (line 29) | def shortestDistance(self, grid): method get_step (line 73) | def get_step(self, ps, axis, pos): method shortestDistance (line 109) | def shortestDistance(self, grid): method get_step (line 156) | def get_step(self, houses, x, y): method shortestDistance (line 176) | def shortestDistance(self, grid): method bfs (line 203) | def bfs(self, grid, x, y, steps): class Solution (line 97) | class Solution: method shortestDistance (line 29) | def shortestDistance(self, grid): method get_step (line 73) | def get_step(self, ps, axis, pos): method shortestDistance (line 109) | def shortestDistance(self, grid): method get_step (line 156) | def get_step(self, houses, x, y): method shortestDistance (line 176) | def shortestDistance(self, grid): method bfs (line 203) | def bfs(self, grid, x, y, steps): class Solution (line 165) | class Solution: method shortestDistance (line 29) | def shortestDistance(self, grid): method get_step (line 73) | def get_step(self, ps, axis, pos): method shortestDistance (line 109) | def shortestDistance(self, grid): method get_step (line 156) | def get_step(self, houses, x, y): method shortestDistance (line 176) | def shortestDistance(self, grid): method bfs (line 203) | def bfs(self, grid, x, y, steps): FILE: lintcode/575_expression_expand.py class Solution (line 1) | class Solution: method expressionExpand (line 2) | def expressionExpand(self, s): FILE: lintcode/578_lowest_common_ancestor_iii.py class Solution (line 14) | class Solution: method lowestCommonAncestor3 (line 15) | def lowestCommonAncestor3(self, root, a, b): method divide_conquer (line 29) | def divide_conquer(self, node, a, b): FILE: lintcode/57_3sum.py class Solution (line 1) | class Solution: method threeSum (line 2) | def threeSum(self, nums): FILE: lintcode/582_word_break_ii.py class Solution (line 1) | class Solution: method wordBreak (line 5) | def wordBreak(self, s, words): method dfs (line 13) | def dfs(self, s, words, memo): method wordBreak (line 48) | def wordBreak(self, s, words): method dfs (line 63) | def dfs(self, s, words, ans, path): class Solution (line 40) | class Solution: method wordBreak (line 5) | def wordBreak(self, s, words): method dfs (line 13) | def dfs(self, s, words, memo): method wordBreak (line 48) | def wordBreak(self, s, words): method dfs (line 63) | def dfs(self, s, words, ans, path): FILE: lintcode/584_drop_eggs_ii.py class Solution (line 6) | class Solution: method dropEggs2 (line 12) | def dropEggs2(self, m, n): FILE: lintcode/585_maximum_number_in_mountain_sequence.py class Solution (line 1) | class Solution: method mountainSequence (line 6) | def mountainSequence(self, nums): FILE: lintcode/586_sqrtx_ii.py class Solution (line 1) | class Solution: method sqrt (line 6) | def sqrt(self, x): FILE: lintcode/587_two_sum_unique_pairs.py class Solution (line 1) | class Solution: method twoSum6 (line 7) | def twoSum6(self, nums, target): FILE: lintcode/589_connecting_graph.py class ConnectingGraph (line 1) | class ConnectingGraph: method __init__ (line 5) | def __init__(self, n): method find (line 13) | def find(self, a): method connect (line 25) | def connect(self, a, b): method query (line 36) | def query(self, a, b): FILE: lintcode/58_4sum.py class Solution (line 1) | class Solution: method fourSum (line 2) | def fourSum(self, nums, target): FILE: lintcode/590_connecting_graph_ii.py class ConnectingGraph2 (line 1) | class ConnectingGraph2: method __init__ (line 5) | def __init__(self, n): method find (line 14) | def find(self, a): method connect (line 25) | def connect(self, a, b): method query (line 37) | def query(self, a): FILE: lintcode/591_connecting_graph_iii.py class ConnectingGraph3 (line 1) | class ConnectingGraph3: method __init__ (line 5) | def __init__(self, n): method find (line 13) | def find(self, a): method connect (line 24) | def connect(self, a, b): method query (line 34) | def query(self): FILE: lintcode/594_strstr_ii.py class Solution (line 34) | class Solution: method strStr2 (line 35) | def strStr2(self, S, T): FILE: lintcode/595_binary_tree_longest_consecutive_sequence.py class Solution (line 13) | class Solution: method longestConsecutive (line 17) | def longestConsecutive(self, root): method divide_conquer (line 27) | def divide_conquer(self, node): method longestConsecutive (line 58) | def longestConsecutive(self, root): method divide_conquer (line 68) | def divide_conquer(self, node, parent_val, _size): class Solution (line 54) | class Solution: method longestConsecutive (line 17) | def longestConsecutive(self, root): method divide_conquer (line 27) | def divide_conquer(self, node): method longestConsecutive (line 58) | def longestConsecutive(self, root): method divide_conquer (line 68) | def divide_conquer(self, node, parent_val, _size): FILE: lintcode/596_minimum_subtree.py class Solution (line 10) | class Solution: method findSubtree (line 18) | def findSubtree(self, root): method _traversal (line 22) | def _traversal(self, node): FILE: lintcode/597_subtree_with_maximum_average.py class Solution (line 19) | class Solution: method findSubtree2 (line 27) | def findSubtree2(self, root): method _traversal (line 31) | def _traversal(self, node): FILE: lintcode/598_zombie_in_matrix.py class Solution (line 1) | class Solution: method zombie (line 10) | def zombie(self, grid): FILE: lintcode/599_insert_into_a_cyclic_sorted_list.py class Solution (line 11) | class Solution: method insert (line 17) | def insert(self, node, x): FILE: lintcode/59_3sum_closest.py class Solution (line 1) | class Solution: method threeSumClosest (line 2) | def threeSumClosest(self, nums, target): FILE: lintcode/5_kth_largest_element.py class Solution (line 1) | class Solution: method kthLargestElement (line 3) | def kthLargestElement(self, k, nums): FILE: lintcode/600_smallest_rectangle_enclosing_black_pixels.py class Solution (line 1) | class Solution: method minArea (line 2) | def minArea(self, image, x, y): method binary_search (line 21) | def binary_search(self, image, start, end, is_empty): method is_empty_row (line 39) | def is_empty_row(self, image, x): method is_empty_col (line 45) | def is_empty_col(self, image, y): FILE: lintcode/601_flatten_2d_vector.py class Vector2D (line 8) | class Vector2D: method __init__ (line 10) | def __init__(self, vec2d): method next (line 16) | def next(self): method hasNext (line 29) | def hasNext(self): FILE: lintcode/602_russian_doll_envelopes.py class Solution (line 9) | class Solution: method maxEnvelopes (line 14) | def maxEnvelopes(self, E): method maxEnvelopes (line 39) | def maxEnvelopes(self, E): class Solution (line 34) | class Solution: method maxEnvelopes (line 14) | def maxEnvelopes(self, E): method maxEnvelopes (line 39) | def maxEnvelopes(self, E): FILE: lintcode/603_largest_divisible_subset.py class Solution (line 1) | class Solution: method largestDivisibleSubset (line 2) | def largestDivisibleSubset(self, A): FILE: lintcode/604_window_sum.py class Solution (line 1) | class Solution: method winSum (line 7) | def winSum(self, A, k): FILE: lintcode/605_sequence_reconstruction.py class Solution (line 10) | class Solution: method sequenceReconstruction (line 11) | def sequenceReconstruction(self, org, seqs): FILE: lintcode/606_kth_largest_element_ii.py class Solution (line 4) | class Solution: method kthLargestElement2 (line 10) | def kthLargestElement2(self, nums, k): FILE: lintcode/607_two_sum_data_structure_design.py class TwoSum (line 1) | class TwoSum: method add (line 8) | def add(self, number): method find (line 18) | def find(self, value): FILE: lintcode/608_two_sum_input_array_is_sorted.py class Solution (line 5) | class Solution: method twoSum (line 11) | def twoSum(self, A, target): method twoSum (line 38) | def twoSum(self, A, target): class Solution (line 32) | class Solution: method twoSum (line 11) | def twoSum(self, A, target): method twoSum (line 38) | def twoSum(self, A, target): FILE: lintcode/609_two_sum_less_than_or_equal_to_target.py class Solution (line 1) | class Solution: method twoSum5 (line 7) | def twoSum5(self, nums, target): FILE: lintcode/610_two_sum_difference_equals_to_target.py class Solution (line 7) | class Solution: method twoSum7 (line 13) | def twoSum7(self, A, target): method twoSum7 (line 57) | def twoSum7(self, A, target): class Solution (line 51) | class Solution: method twoSum7 (line 13) | def twoSum7(self, A, target): method twoSum7 (line 57) | def twoSum7(self, A, target): FILE: lintcode/611_knight_shortest_path.py class Solution (line 10) | class Solution: method shortestPath (line 28) | def shortestPath(self, G, S, T): FILE: lintcode/612_k_closest_points.py class Solution (line 11) | class Solution: method kClosest (line 15) | def kClosest(self, points, origin, k): method get_distance (line 38) | def get_distance(self, p, q): method kClosest (line 51) | def kClosest(self, points, origin, k): method get_distance (line 77) | def get_distance(self, p, q): class Solution (line 47) | class Solution: method kClosest (line 15) | def kClosest(self, points, origin, k): method get_distance (line 38) | def get_distance(self, p, q): method kClosest (line 51) | def kClosest(self, points, origin, k): method get_distance (line 77) | def get_distance(self, p, q): FILE: lintcode/613_high_five.py class Solution (line 11) | class Solution: method highFive (line 15) | def highFive(self, results): FILE: lintcode/614_binary_tree_longest_consecutive_sequence_ii.py class Solution (line 17) | class Solution: method longestConsecutive2 (line 21) | def longestConsecutive2(self, root): method divide_conquer (line 31) | def divide_conquer(self, node): FILE: lintcode/615_course_schedule.py class Solution (line 1) | class Solution: method canFinish (line 2) | def canFinish(self, n, P): FILE: lintcode/616_course_schedule_ii.py class Solution (line 1) | class Solution: method findOrder (line 2) | def findOrder(self, n, prerequisites): FILE: lintcode/617_maximum_average_subarray.py class Solution (line 32) | class Solution: method maxAverage (line 33) | def maxAverage(self, nums, k): method is_valid (line 64) | def is_valid(self, nums, k, mid, s): FILE: lintcode/618_search_graph_nodes.py class Solution (line 18) | class Solution: method searchNode (line 26) | def searchNode(self, graph, values, node, target): FILE: lintcode/619_binary_tree_longest_consecutive_sequence_iii.py class Solution (line 13) | class Solution: method longestConsecutive3 (line 17) | def longestConsecutive3(self, root): method divide_conquer (line 27) | def divide_conquer(self, node): FILE: lintcode/61_search_for_a_range.py class Solution (line 1) | class Solution: method searchRange (line 7) | def searchRange(self, A, target): FILE: lintcode/620_maximum_subarray_iv.py class Solution (line 1) | class Solution: method maxSubarray4 (line 7) | def maxSubarray4(self, A, k): FILE: lintcode/621_maximum_subarray_v.py class Solution (line 15) | class Solution: method maxSubarray5 (line 22) | def maxSubarray5(self, A, k1, k2): FILE: lintcode/622_frog_jump.py class Solution (line 4) | class Solution: method canCross (line 5) | def canCross(self, stones): method canCross (line 40) | def canCross(self, stones): class Solution (line 39) | class Solution: method canCross (line 5) | def canCross(self, stones): method canCross (line 40) | def canCross(self, stones): FILE: lintcode/623_k_edit_distance.py class TrieNode (line 1) | class TrieNode: method __init__ (line 2) | def __init__(self): class Trie (line 7) | class Trie: method __init__ (line 8) | def __init__(self): method put (line 11) | def put(self, word): class Solution (line 26) | class Solution: method kDistance (line 27) | def kDistance(self, words, target, k): method dfs (line 46) | def dfs(self, node, k, target, ans, pre): FILE: lintcode/624_remove_substrings.py class Solution (line 1) | class Solution: method minLength (line 7) | def minLength(self, s, D): FILE: lintcode/625_partition_array_ii.py class Solution (line 4) | class Solution: method partition2 (line 11) | def partition2(self, A, low, high): FILE: lintcode/630_knight_shortest_path_ii.py class Solution (line 4) | class Solution: method shortestPath2 (line 9) | def shortestPath2(self, G): method shortestPath2 (line 50) | def shortestPath2(self, G): class Solution (line 45) | class Solution: method shortestPath2 (line 9) | def shortestPath2(self, G): method shortestPath2 (line 50) | def shortestPath2(self, G): FILE: lintcode/633_find_the_duplicate_number.py class Solution (line 10) | class Solution: method findDuplicate (line 11) | def findDuplicate(self, A): method after_dup (line 34) | def after_dup(self, A, mid): method findDuplicate (line 70) | def findDuplicate(self, A): class Solution (line 65) | class Solution: method findDuplicate (line 11) | def findDuplicate(self, A): method after_dup (line 34) | def after_dup(self, A, mid): method findDuplicate (line 70) | def findDuplicate(self, A): FILE: lintcode/634_word_squares.py class Solution (line 10) | class Solution: method wordSquares (line 11) | def wordSquares(self, words): method dfs (line 24) | def dfs(self, words, n, ans, path): method is_valid (line 38) | def is_valid(self, path): FILE: lintcode/635_boggle_game.py class TrieNode (line 1) | class TrieNode: method __init__ (line 2) | def __init__(self): class Solution (line 7) | class Solution: method boggleGame (line 8) | def boggleGame(self, board, words): method dfs (line 36) | def dfs(self, board, i, j, root, visited, cnt): method find_next_words (line 55) | def find_next_words(self, board, x, y, visited, cnt, node, next_words,... method put (line 84) | def put(self, root, word): FILE: lintcode/636_132_pattern.py class Solution (line 1) | class Solution: method find132pattern (line 6) | def find132pattern(self, A): FILE: lintcode/646_first_position_unique_character.py class Solution (line 1) | class Solution: method firstUniqChar (line 6) | def firstUniqChar(self, s): FILE: lintcode/647_substring_anagrams.py class Solution (line 6) | class Solution: method findAnagrams (line 7) | def findAnagrams(self, s, t): FILE: lintcode/64_merge_sorted_array.py class Solution (line 1) | class Solution: method mergeSortedArray (line 2) | def mergeSortedArray(self, a, m, b, n): FILE: lintcode/654_sparse_matrix_multiplication.py class Solution (line 1) | class Solution: method multiply (line 7) | def multiply(self, A, B): FILE: lintcode/655_big_integer_addition.py class Solution (line 1) | class Solution: method addStrings (line 2) | def addStrings(self, a, b): FILE: lintcode/656_big_integer_multiplication.py class Solution (line 1) | class Solution: method multiply (line 2) | def multiply(self, a, b): FILE: lintcode/65_median_of_two_sorted_arrays.py class Solution (line 7) | class Solution: method findMedianSortedArrays (line 8) | def findMedianSortedArrays(self, a, b): method findMedianSortedArrays (line 51) | def findMedianSortedArrays(self, A, B): method find_kth (line 61) | def find_kth(self, A, i, B, j, k): class Solution (line 45) | class Solution: method findMedianSortedArrays (line 8) | def findMedianSortedArrays(self, a, b): method findMedianSortedArrays (line 51) | def findMedianSortedArrays(self, A, B): method find_kth (line 61) | def find_kth(self, A, i, B, j, k): FILE: lintcode/662_guess_number_game.py class Solution (line 9) | class Solution: method guessNumber (line 10) | def guessNumber(self, n): FILE: lintcode/664_counting_bits.py class Solution (line 1) | class Solution: method countBits (line 6) | def countBits(self, num): FILE: lintcode/667_longest_palindromic_subsequence.py class Solution (line 1) | class Solution: method longestPalindromeSubseq (line 6) | def longestPalindromeSubseq(self, s): FILE: lintcode/668_ones_and_zeroes.py class Solution (line 4) | class Solution: method findMaxForm (line 11) | def findMaxForm(self, strs, m, n): method findMaxForm (line 50) | def findMaxForm(self, strs, m, n): class Solution (line 43) | class Solution: method findMaxForm (line 11) | def findMaxForm(self, strs, m, n): method findMaxForm (line 50) | def findMaxForm(self, strs, m, n): FILE: lintcode/669_coin_change.py class Solution (line 1) | class Solution: method coinChange (line 5) | def coinChange(self, coins, amount): method coinChange (line 44) | def coinChange(self, coins, amount): class Solution (line 40) | class Solution: method coinChange (line 5) | def coinChange(self, coins, amount): method coinChange (line 44) | def coinChange(self, coins, amount): FILE: lintcode/66_binary_tree_preorder_traversal.py class Solution (line 10) | class Solution: method preorderTraversal (line 15) | def preorderTraversal(self, root): method _traversal (line 22) | def _traversal(self, node, res): FILE: lintcode/676_decode_ways_ii.py class Solution (line 1) | class Solution: method numDecodings (line 6) | def numDecodings(self, s): FILE: lintcode/67_binary_tree_inorder_traversal.py class Solution (line 10) | class Solution: method inorderTraversal (line 15) | def inorderTraversal(self, root): method _traversal (line 22) | def _traversal(self, node, res): FILE: lintcode/689_two_sum_bst_edtion.py class Solution (line 10) | class Solution: method twoSum (line 16) | def twoSum(self, root, n): method pre (line 34) | def pre(self): method nxt (line 56) | def nxt(self): FILE: lintcode/68_binary_tree_postorder_traversal.py class Solution (line 10) | class Solution: method postorderTraversal (line 15) | def postorderTraversal(self, root): FILE: lintcode/69_binary_tree_level_order_traversal.py class Solution (line 17) | class Solution: method levelOrder (line 18) | def levelOrder(self, root): FILE: lintcode/6_merge_two_sorted_arrays.py class Solution (line 1) | class Solution: method mergeSortedArray (line 7) | def mergeSortedArray(self, A, B): FILE: lintcode/70_binary_tree_level_order_traversal_ii.py class Solution (line 10) | class Solution: method levelOrderBottom (line 15) | def levelOrderBottom(self, root): method dfs (line 33) | def dfs(self, node, ans, preorder, parent_at): FILE: lintcode/717_tree_longest_path_with_same_value.py class Solution (line 6) | class Solution: method LongestPathWithSameValue (line 7) | def LongestPathWithSameValue(self, a, e): method dfs (line 28) | def dfs(self, root, curr, a, neibs): FILE: lintcode/718_repeat_string.py class Solution (line 1) | class Solution: method repeatedString (line 2) | def repeatedString(self, a, b): FILE: lintcode/71_binary_tree_zigzag_level_order_traversal.py class Solution (line 10) | class Solution: method zigzagLevelOrder (line 15) | def zigzagLevelOrder(self, root): FILE: lintcode/724_minimum_partition.py class Solution (line 1) | class Solution: method findMin (line 2) | def findMin(self, nums): FILE: lintcode/725_boolean_parenthesization.py class Solution (line 6) | class Solution: method countParenth (line 7) | def countParenth(self, symb, oper): FILE: lintcode/729_last_digit_by_factorial_divide.py class Solution (line 1) | class Solution: method computeLastDigit (line 2) | def computeLastDigit(self, a, b): FILE: lintcode/745_palindromic_ranges.py class Solution (line 1) | class Solution: method PalindromicRanges (line 2) | def PalindromicRanges(self, left, right): method is_palindrome (line 31) | def is_palindrome(self, num): FILE: lintcode/74_first_bad_version.py class Solution (line 16) | class Solution: method findFirstBadVersion (line 17) | def findFirstBadVersion(self, n): FILE: lintcode/752_rogue_knight_sven.py class Solution (line 1) | class Solution: method getNumberOfWays (line 2) | def getNumberOfWays(self, n, m, limit, cost): FILE: lintcode/75_find_peak_element.py class Solution (line 1) | class Solution: method findPeak (line 2) | def findPeak(self, nums): FILE: lintcode/76_longest_increasing_subsequence.py class Solution (line 4) | class Solution: method longestIncreasingSubsequence (line 5) | def longestIncreasingSubsequence(self, A): method binary_search (line 39) | def binary_search(self, P, a): method longestIncreasingSubsequence (line 56) | def longestIncreasingSubsequence(self, A): class Solution (line 55) | class Solution: method longestIncreasingSubsequence (line 5) | def longestIncreasingSubsequence(self, A): method binary_search (line 39) | def binary_search(self, P, a): method longestIncreasingSubsequence (line 56) | def longestIncreasingSubsequence(self, A): FILE: lintcode/772_group_anagrams.py class Solution (line 1) | class Solution: method groupAnagrams (line 6) | def groupAnagrams(self, s): FILE: lintcode/775_palindrome_pairs.py class Solution (line 9) | class Solution: method palindromePairs (line 10) | def palindromePairs(self, words): method is_palindrome (line 48) | def is_palindrome(self, word): method palindromePairs (line 66) | def palindromePairs(self, words): method is_palindrome (line 88) | def is_palindrome(self, words, i, j): method palindromePairs (line 112) | def palindromePairs(self, words): method is_palindrome (line 134) | def is_palindrome(self, s): class Solution (line 65) | class Solution: method palindromePairs (line 10) | def palindromePairs(self, words): method is_palindrome (line 48) | def is_palindrome(self, word): method palindromePairs (line 66) | def palindromePairs(self, words): method is_palindrome (line 88) | def is_palindrome(self, words, i, j): method palindromePairs (line 112) | def palindromePairs(self, words): method is_palindrome (line 134) | def is_palindrome(self, s): class Solution (line 111) | class Solution: method palindromePairs (line 10) | def palindromePairs(self, words): method is_palindrome (line 48) | def is_palindrome(self, word): method palindromePairs (line 66) | def palindromePairs(self, words): method is_palindrome (line 88) | def is_palindrome(self, words, i, j): method palindromePairs (line 112) | def palindromePairs(self, words): method is_palindrome (line 134) | def is_palindrome(self, s): FILE: lintcode/776_strobogrammatic_number_ii.py class Solution (line 1) | class Solution: method findStrobogrammatic (line 2) | def findStrobogrammatic(self, n): FILE: lintcode/77_longest_common_subsequence.py class Solution (line 1) | class Solution: method longestCommonSubsequence (line 7) | def longestCommonSubsequence(self, A, B): FILE: lintcode/784_the_longest_common_prefix_ii.py class Solution (line 1) | class Solution: method theLongestCommonPrefix (line 7) | def theLongestCommonPrefix(self, D, target): FILE: lintcode/790_parser.py class Solution (line 1) | class Solution: method canBeGenerated (line 8) | def canBeGenerated(self, S, start, end): method dfs (line 22) | def dfs(self, N, end, s): FILE: lintcode/791_merge_number.py class Solution (line 4) | class Solution: method mergeNumber (line 9) | def mergeNumber(self, A): FILE: lintcode/792_kth_prime_number.py class Solution (line 1) | class Solution: method kthPrime (line 6) | def kthPrime(self, n): FILE: lintcode/793_intersection_of_arrays.py class Solution (line 1) | class Solution: method intersectionOfArrays (line 6) | def intersectionOfArrays(self, A): FILE: lintcode/7_binary_tree_serialization.py class Solution (line 10) | class Solution: method serialize (line 13) | def serialize(self, root): method deserialize (line 39) | def deserialize(self, data): FILE: lintcode/813_find_anagram_mappings.py class Solution (line 4) | class Solution: method anagramMappings (line 5) | def anagramMappings(self, a, b): method anagramMappings (line 34) | def anagramMappings(self, a, b): class Solution (line 33) | class Solution: method anagramMappings (line 5) | def anagramMappings(self, a, b): method anagramMappings (line 34) | def anagramMappings(self, a, b): FILE: lintcode/81_data_stream_median.py class Solution (line 4) | class Solution: method medianII (line 5) | def medianII(self, nums): FILE: lintcode/823_input_stream.py class Solution (line 6) | class Solution: method inputStream (line 7) | def inputStream(self, a, b): method inputStream (line 53) | def inputStream(self, a, b): class Solution (line 52) | class Solution: method inputStream (line 7) | def inputStream(self, a, b): method inputStream (line 53) | def inputStream(self, a, b): FILE: lintcode/824_single_number_iv.py class Solution (line 1) | class Solution: method getSingleNumber (line 2) | def getSingleNumber(self, nums): FILE: lintcode/826_computer_maintenance.py class Solution (line 1) | class Solution: method maintenance (line 8) | def maintenance(self, m, n, P): FILE: lintcode/830_string_sort.py class Solution (line 1) | class Solution: method stringSort (line 6) | def stringSort(self, s): FILE: lintcode/831_3sum_ii.py class Solution (line 1) | class Solution: method threeSum2 (line 6) | def threeSum2(self, n): method threeSum2 (line 48) | def threeSum2(self, n): class Solution (line 43) | class Solution: method threeSum2 (line 6) | def threeSum2(self, n): method threeSum2 (line 48) | def threeSum2(self, n): FILE: lintcode/832_count_negative_number.py class Solution (line 1) | class Solution: method countNumber (line 6) | def countNumber(self, g): FILE: lintcode/833_process_sequence.py class Solution (line 1) | class Solution: method numberOfProcesses (line 7) | def numberOfProcesses(self, logs, queries): FILE: lintcode/85_insert_node_in_a_binary_search_tree.py class Solution (line 11) | class Solution: method insertNode (line 17) | def insertNode(self, root, node): method insertNode (line 36) | def insertNode(self, root, node): class Solution (line 30) | class Solution: method insertNode (line 17) | def insertNode(self, root, node): method insertNode (line 36) | def insertNode(self, root, node): FILE: lintcode/86_binary_search_tree_iterator.py class BSTIterator (line 16) | class BSTIterator: method __init__ (line 20) | def __init__(self, root): method hasNext (line 27) | def hasNext(self): method next (line 33) | def next(self): FILE: lintcode/87_remove_node_in_binary_search_tree.py class Solution (line 14) | class Solution: method removeNode (line 20) | def removeNode(self, root, target): method find_min (line 43) | def find_min(self, node): FILE: lintcode/88_lowest_common_ancestor.py class Solution (line 14) | class Solution: method lowestCommonAncestor (line 15) | def lowestCommonAncestor(self, root, a, b): FILE: lintcode/89_k_sum.py class Solution (line 1) | class Solution: method kSum (line 8) | def kSum(self, A, K, target): FILE: lintcode/8_rotate_string.py class Solution (line 1) | class Solution: method rotateString (line 7) | def rotateString(self, S, x): method reverse (line 17) | def reverse(self, S, start, end): FILE: lintcode/900_closest_binary_search_tree_value.py class Solution (line 10) | class Solution: method closestValue (line 11) | def closestValue(self, root, target): FILE: lintcode/901_closest_binary_search_tree_value_ii.py class Solution (line 10) | class Solution: method closestKValues (line 11) | def closestKValues(self, root, target, k): method inorder_traverse (line 54) | def inorder_traverse(self, root, vals): FILE: lintcode/919_meeting_rooms_ii.py class Solution (line 10) | class Solution: method minMeetingRooms (line 11) | def minMeetingRooms(self, intervals): FILE: lintcode/920_meeting_rooms.py class Solution (line 15) | class Solution: method canAttendMeetings (line 16) | def canAttendMeetings(self, intervals): method canAttendMeetings (line 49) | def canAttendMeetings(self, intervals): class Solution (line 48) | class Solution: method canAttendMeetings (line 16) | def canAttendMeetings(self, intervals): method canAttendMeetings (line 49) | def canAttendMeetings(self, intervals): FILE: lintcode/92_backpack.py class Solution (line 1) | class Solution: method backPack (line 5) | def backPack(self, m, A): FILE: lintcode/93_balanced_binary_tree.py class Solution (line 10) | class Solution: method isBalanced (line 15) | def isBalanced(self, root): method _divide_conquer (line 18) | def _divide_conquer(self, node): FILE: lintcode/95_validate_binary_search_tree.py class Solution (line 17) | class Solution: method isValidBST (line 18) | def isValidBST(self, root): method isValidBST (line 48) | def isValidBST(self, root): class Solution (line 44) | class Solution: method isValidBST (line 18) | def isValidBST(self, root): method isValidBST (line 48) | def isValidBST(self, root): FILE: lintcode/96_partition_list.py class Solution (line 11) | class Solution: method partition (line 17) | def partition(self, head, x): FILE: lintcode/97_maximum_depth_of_binary_tree.py class Solution (line 10) | class Solution: method maxDepth (line 15) | def maxDepth(self, root): FILE: lintcode/98_sort_list.py class Solution (line 11) | class Solution: method sortList (line 16) | def sortList(self, head): method quick_sort (line 19) | def quick_sort(self, head): method merge_sort (line 53) | def merge_sort(self, head): method find_middle (line 83) | def find_middle(self, head): method get_tail (line 92) | def get_tail(self, head): FILE: lintcode/9_fizz_buzz.py class Solution (line 1) | class Solution: method fizzBuzz (line 2) | def fizzBuzz(self, n): method fizzBuzz (line 26) | def fizzBuzz(self, n): class Solution (line 25) | class Solution: method fizzBuzz (line 2) | def fizzBuzz(self, n): method fizzBuzz (line 26) | def fizzBuzz(self, n): FILE: other/anti_queue_reconstruction_by_height.py function reorder (line 6) | def reorder(nums): FILE: other/binary_tree_maximum_path_product.py class Solution (line 66) | class Solution: method maxPathProd (line 67) | def maxPathProd(self, root): method divide_conquer (line 78) | def divide_conquer(self, node): FILE: other/candy_crush.py function _check_board_valid (line 50) | def _check_board_valid(board): class CandyCrush (line 67) | class CandyCrush: method __init__ (line 68) | def __init__(self, m, n, q): method reset_board (line 85) | def reset_board(self): method get_board (line 121) | def get_board(self): method _check_cell_valid (line 127) | def _check_cell_valid(self, x, y): method _print_board (line 155) | def _print_board(self): FILE: other/card_shuffler.py function card_shuffler (line 13) | def card_shuffler(cards, shuffles): function get_offset (line 30) | def get_offset(start, shuffles): function get_lcm (line 43) | def get_lcm(*nums): function get_gcd (line 52) | def get_gcd(a, b): FILE: other/deep_fetch.js function deepFetch (line 1) | function deepFetch(target, path, defaultValue = undefined) { FILE: other/find_treasure_in_maze.py class Solution (line 40) | class Solution: method find_treasure_in_maze (line 48) | def find_treasure_in_maze(self, maze): method bfs (line 85) | def bfs(self, maze, queue, keys, holds, doors, visited): method is_possible (line 131) | def is_possible(self, maze, keys, holds, doors): FILE: other/find_ways_in_board_game.py function find_ways_in_board_game (line 18) | def find_ways_in_board_game(n): FILE: other/freq_iterator.py class FreqIterator (line 45) | class FreqIterator: method __init__ (line 46) | def __init__(self, iterator): method next (line 54) | def next(self): method has_next (line 71) | def has_next(self): class ListIterator (line 75) | class ListIterator: method __init__ (line 76) | def __init__(self, words): method next (line 80) | def next(self): method has_next (line 88) | def has_next(self): FILE: other/gcd_and_lcm.py function get_gcd (line 1) | def get_gcd(a, b): function get_lcm (line 17) | def get_lcm(a, b): FILE: other/get_most_popular_word.py class Solution (line 67) | class Solution: method __init__ (line 68) | def __init__(self, W): method insert (line 81) | def insert(self, word): method get_most_popular_word (line 94) | def get_most_popular_word(self): method _add_word (line 97) | def _add_word(self, word): method _evict_word (line 125) | def _evict_word(self): class WordNode (line 155) | class WordNode: method __init__ (line 156) | def __init__(self, word, freq_node=None, pre=None, nxt=None): method link (line 162) | def link(self, pre, nxt): method unlink (line 168) | def unlink(self): class FreqNode (line 174) | class FreqNode: method __init__ (line 175) | def __init__(self, freq, pre=None, nxt=None): method unlink (line 183) | def unlink(self): method before (line 188) | def before(self, freq_node): method after (line 194) | def after(self, freq_node): method is_empty (line 200) | def is_empty(self): method append_tail (line 203) | def append_tail(self, word_node): FILE: other/guess_secret.py function find_secret (line 19) | def find_secret(secret, words): class Secret (line 50) | class Secret: method __init__ (line 51) | def __init__(self, word): method guess (line 55) | def guess(self, word): FILE: other/inorder_non_threaded_binary_tree_traversal.py function inorder_traverse (line 108) | def inorder_traverse(root, *, callback): FILE: other/is_valid_relation.py function is_valid_relation (line 37) | def is_valid_relation(strs): function dfs (line 79) | def dfs(graph, node, visited): FILE: other/merge_mail.py function merge_mail (line 1) | def merge_mail(data): function connect (line 41) | def connect(nodes, a, b): function find (line 48) | def find(nodes, a): FILE: other/reservation.py class Reservation (line 17) | class Reservation: method __init__ (line 18) | def __init__(self, m, n): method get_seats (line 21) | def get_seats(self, user_id, n=0): FILE: other/robot_cleaner.py class Dirs (line 159) | class Dirs: class Room (line 178) | class Room: method __init__ (line 184) | def __init__(self, grid): method is_clear (line 202) | def is_clear(self): method move_robot (line 208) | def move_robot(self, direction): method clean (line 227) | def clean(self, robot): method _get_robot (line 241) | def _get_robot(self): method _print_room (line 245) | def _print_room(self): class Robot (line 255) | class Robot: method __init__ (line 256) | def __init__(self, room): method move (line 263) | def move(self, direction=None): method turnleft (line 273) | def turnleft(self, k=1): method turnrigt (line 281) | def turnrigt(self, k=1): method clean (line 290) | def clean(self): method _get_face (line 296) | def _get_face(self): class RobotCleanerDFS (line 301) | class RobotCleanerDFS: method clean_room (line 306) | def clean_room(self, robot): method dfs (line 323) | def dfs(self, x, y, to_dir, robot, visited): class RobotCleanerDFS2 (line 372) | class RobotCleanerDFS2: method clean_room (line 376) | def clean_room(self, robot): method dfs (line 390) | def dfs(self, x, y, from_dir, robot, visited): class RobotCleanerBFS (line 415) | class RobotCleanerBFS: method clean_room (line 416) | def clean_room(self, robot): method bfs (line 423) | def bfs(self): FILE: other/snake_and_ladder_problem.py function get_min_dice_throws (line 6) | def get_min_dice_throws(moves): FILE: other/stock_stream.py class StockStream (line 1) | class StockStream: method __init__ (line 2) | def __init__(self, prices): method update (line 5) | def update(self, timestamp, price): method get_highest (line 13) | def get_highest(self): method get_lowest (line 19) | def get_lowest(self): method get_latest (line 25) | def get_latest(self): FILE: other/string_abbreviation.py function encode (line 31) | def encode(s): function decode (line 69) | def decode(s): FILE: other/the_point_inside_polygon.py function get_random_point_inside_rectangle (line 19) | def get_random_point_inside_rectangle(rectangle): function get_random_point_inside_rectangle2 (line 37) | def get_random_point_inside_rectangle2(rectangles): function get_random_point_inside_rectangle3 (line 61) | def get_random_point_inside_rectangle3(rectangles): function is_point_inside_polygon (line 72) | def is_point_inside_polygon(polygon, point): FILE: other/uneven_random_get.py function uneven_random_get (line 8) | def uneven_random_get(options, rate): function uneven_random_get2 (line 29) | def uneven_random_get2(options, rate): FILE: other/unique_paths_with_followups.py function find_unique_paths (line 16) | def find_unique_paths(m, n): function find_unique_paths1 (line 51) | def find_unique_paths1(m, n): function find_unique_paths2 (line 89) | def find_unique_paths2(m, n, points): function find_unique_paths3 (line 131) | def find_unique_paths3(m, n, points): function find_unique_paths4 (line 192) | def find_unique_paths4(m, n, h): function find_unique_paths5 (line 247) | def find_unique_paths5(m, n): FILE: other/unique_word_abbreviation_ii.py function find_unique_abbreviations (line 47) | def find_unique_abbreviations(words): class WordIterator (line 87) | class WordIterator: method __init__ (line 88) | def __init__(self, word): method __iter__ (line 92) | def __iter__(self): FILE: other/upside_down_numbers.py function find_upside_down_numbers (line 1) | def find_upside_down_numbers(n): function get_reversed_number (line 56) | def get_reversed_number(s, up_down_nums): FILE: pramp/array_index_and_element_equality.py function index_equals_value_search (line 1) | def index_equals_value_search(nums): FILE: pramp/array_of_array_products.py function array_of_array_products (line 14) | def array_of_array_products(nums): FILE: pramp/award_budget_cuts.py function find_grants_cap (line 37) | def find_grants_cap(grantsArray, newBudget): FILE: pramp/bracket_match.py function bracket_match (line 1) | def bracket_match(text): FILE: pramp/busiest_time_in_the_mall.py function find_busiest_period (line 1) | def find_busiest_period(data): FILE: pramp/decrypt_message.py function encrypt (line 41) | def encrypt(word): function decrypt (line 56) | def decrypt(word): function decrypt2 (line 72) | def decrypt2(word): FILE: pramp/deletion_distance.py function deletion_distance (line 17) | def deletion_distance(s, t): function deletion_distance2 (line 48) | def deletion_distance2(s, t): FILE: pramp/drone_flight_planner.py function calc_drone_min_energy (line 1) | def calc_drone_min_energy(route): FILE: pramp/find_the_duplicates.py function find_duplicates (line 1) | def find_duplicates(arr1, arr2): function find_duplicates2 (line 24) | def find_duplicates2(arr1, arr2): function find_duplicates3 (line 43) | def find_duplicates3(arr1, arr2): FILE: pramp/flatten_a_dictionary.py function flatten_dictionary (line 1) | def flatten_dictionary(dictionary): function dfs (line 11) | def dfs(dictionary, keys, ans): FILE: pramp/h_tree_construction.py function draw_line (line 1) | def draw_line(x1, y1, x2, y2): function draw_h_tree (line 5) | def draw_h_tree(x, y, length, depth): function draw_h_tree2 (line 35) | def draw_h_tree2(x, y, length, depth): FILE: pramp/k_messed_array_sort.py function sort_k_messed_array (line 4) | def sort_k_messed_array(nums, k): FILE: pramp/largest_smaller_bst_node.py function largest_smaller_bst_node (line 1) | def largest_smaller_bst_node(root, target): FILE: pramp/number_of_paths.py function num_of_paths_to_dest (line 1) | def num_of_paths_to_dest(n): FILE: pramp/pairs_with_specific_difference.py function find_pairs_with_given_difference (line 1) | def find_pairs_with_given_difference(arr, k): FILE: pramp/pancake_sort.py function pancake_sort (line 42) | def pancake_sort(nums): function flip (line 55) | def flip(nums, k): function get_max_index (line 76) | def get_max_index(nums, i): FILE: pramp/root_of_number.py function root (line 18) | def root(x, n): function get_product (line 39) | def get_product(x, n): FILE: pramp/sales_path.py function get_cheapest_cost (line 69) | def get_cheapest_cost(root): function get_cheapest_cost_paths (line 86) | def get_cheapest_cost_paths(root): function _dfs (line 98) | def _dfs(root, target, ans, path): FILE: pramp/sentence_reverse.py function reverse_words (line 37) | def reverse_words(arr): function reverse_words2 (line 44) | def reverse_words2(arr): function reverse_in_range (line 73) | def reverse_in_range(arr, i, j): FILE: pramp/smallest_substring_of_all_characters.py function get_shortest_unique_substring (line 1) | def get_shortest_unique_substring(strs, s): FILE: pramp/time_planner.py function meeting_planner (line 1) | def meeting_planner(slots1, slots2, duration): FILE: pramp/word_count_engine.py function word_count_engine (line 25) | def word_count_engine(document): function word_count_engine2 (line 57) | def word_count_engine2(document): FILE: topic/_test/python/test_base.py class TaskTimer (line 5) | class TaskTimer: method __init__ (line 6) | def __init__(self): method reset_time (line 9) | def reset_time(self): method print_duration (line 12) | def print_duration(self): class TestBase (line 17) | class TestBase(unittest.TestCase): method setUpClass (line 21) | def setUpClass(cls): method tearDownClass (line 28) | def tearDownClass(cls): method setUp (line 34) | def setUp(self): method tearDown (line 37) | def tearDown(self): FILE: topic/bit_manipulation/python/calculator_in_bit.py class Calculator (line 59) | class Calculator: method _plus (line 63) | def _plus(cls, a, b): method plus (line 73) | def plus(cls, a, b): method minus (line 84) | def minus(cls, a, b): method times (line 88) | def times(cls, a, b): method divide (line 110) | def divide(cls, a, b): FILE: topic/bit_manipulation/python/calculator_in_bit__test.py class TestBitCalculator (line 5) | class TestBitCalculator(TestBase): method test_plus_recursion (line 31) | def test_plus_recursion(self): method test_plus_iteration (line 35) | def test_plus_iteration(self): method test_minus (line 39) | def test_minus(self): method test_times (line 43) | def test_times(self): method test_divide (line 47) | def test_divide(self): FILE: topic/graph/python/union_find.py class UnionFind (line 1) | class UnionFind: method __init__ (line 2) | def __init__(self): method union (line 5) | def union(self, u, v): method find (line 14) | def find(self, u): FILE: topic/graph/python/union_find__test.py class TestUnionFind (line 5) | class TestUnionFind(TestBase): method test_init (line 6) | def test_init(self): method test_union (line 11) | def test_union(self): method test_compression (line 21) | def test_compression(self): FILE: topic/hash/python/geohash.py class GeoHash (line 19) | class GeoHash: method __init__ (line 20) | def __init__(self): method encode (line 33) | def encode(self, latitude, longitude, precision=5): method decode (line 50) | def decode(self, geohash): method _bin_to_pos (line 67) | def _bin_to_pos(self, bincode, start, end): method _pos_to_bin (line 78) | def _pos_to_bin(self, position, digits, start, end): FILE: topic/hash/python/geohash__test.py class TestGeoHash (line 5) | class TestGeoHash(TestBase): method test_encode (line 23) | def test_encode(self): method test_decode (line 29) | def test_decode(self): FILE: topic/hash/python/hashtable.py class HashTable (line 1) | class HashTable: method __init__ (line 2) | def __init__(self, cap=4000, power=31): method __repr__ (line 8) | def __repr__(self): method __len__ (line 16) | def __len__(self): method __setitem__ (line 19) | def __setitem__(self, key, val): method __getitem__ (line 22) | def __getitem__(self, key): method __delitem__ (line 25) | def __delitem__(self, key): method __iter__ (line 28) | def __iter__(self): method keys (line 32) | def keys(self): method values (line 36) | def values(self): method items (line 40) | def items(self): method set (line 48) | def set(self, key, val): method get (line 67) | def get(self, key): method remove (line 83) | def remove(self, key): method _encode (line 106) | def _encode(self, key): class ListNode (line 118) | class ListNode: method __init__ (line 119) | def __init__(self, key, val, nxt=None): FILE: topic/hash/python/hashtable__test.py class TestHashTable (line 5) | class TestHashTable(TestBase): method test_operation (line 6) | def test_operation(self): method test_collision (line 33) | def test_collision(self): FILE: topic/heap/python/binary_hash_heap.py class BinaryHashHeap (line 4) | class BinaryHashHeap: method __init__ (line 7) | def __init__(self, iterable=None): method __len__ (line 15) | def __len__(self): method __bool__ (line 18) | def __bool__(self): method heapify (line 21) | def heapify(self, iterable): method push (line 28) | def push(self, val): method pop (line 35) | def pop(self): method remove (line 54) | def remove(self, val): method top (line 71) | def top(self): method _siftdown (line 77) | def _siftdown(self, i): method _siftup (line 88) | def _siftup(self, i): method _swap (line 103) | def _swap(self, i, j): FILE: topic/heap/python/binary_heap.py class BinaryHeap (line 4) | class BinaryHeap: method __init__ (line 7) | def __init__(self, iterable=None): method __len__ (line 14) | def __len__(self): method __bool__ (line 17) | def __bool__(self): method heapify (line 20) | def heapify(self, iterable): method push (line 27) | def push(self, val): method pop (line 33) | def pop(self): method top (line 47) | def top(self): method _siftdown (line 53) | def _siftdown(self, i): method _siftup (line 64) | def _siftup(self, i): FILE: topic/heap/python/heap__test.py class TestHeap (line 5) | class TestHeap(TestBase): method _test_heapify (line 6) | def _test_heapify(self, Heap): method _test_push (line 22) | def _test_push(self, Heap): method _test_pop (line 42) | def _test_pop(self, Heap): method _test_remove (line 58) | def _test_remove(self, Heap): method _test_top (line 106) | def _test_top(self, Heap): method _run_heap_test (line 121) | def _run_heap_test(self, Heap): method _run_removable_heap_test (line 127) | def _run_removable_heap_test(self, Heap): method test_binary_hash_heap (line 134) | def test_binary_hash_heap(self): method test_binary_heap (line 137) | def test_binary_heap(self): method test_lazy_removable_heapq (line 140) | def test_lazy_removable_heapq(self): method test_removable_heapq (line 143) | def test_removable_heapq(self): FILE: topic/heap/python/lazy_removable_heapq.py class LazyRemovableHeapq (line 5) | class LazyRemovableHeapq: method __init__ (line 8) | def __init__(self, iterable=None): method __len__ (line 16) | def __len__(self): method __bool__ (line 19) | def __bool__(self): method heapify (line 22) | def heapify(self, iterable): method push (line 29) | def push(self, val): method pop (line 34) | def pop(self): method remove (line 43) | def remove(self, val): method top (line 50) | def top(self): method _is_empty (line 56) | def _is_empty(self): FILE: topic/heap/python/removable_heapq.py class RemovableHeapq (line 11) | class RemovableHeapq: method __init__ (line 14) | def __init__(self, iterable=None): method __len__ (line 20) | def __len__(self): method __bool__ (line 23) | def __bool__(self): method heapify (line 26) | def heapify(self, iterable): method push (line 33) | def push(self, val): method pop (line 36) | def pop(self): method remove (line 42) | def remove(self, val): method top (line 62) | def top(self): FILE: topic/linked_list/python/_helper.py class ListNode (line 9) | class ListNode: method __init__ (line 10) | def __init__(self, val, nxt=None): class DoublyListNode (line 15) | class DoublyListNode: method __init__ (line 16) | def __init__(self, val, pre=None, nxt=None): class ListBase (line 22) | class ListBase(ABC): method __repr__ (line 23) | def __repr__(self): method __str__ (line 26) | def __str__(self): method __bool__ (line 29) | def __bool__(self): method __len__ (line 32) | def __len__(self): method to_list (line 36) | def to_list(self): method contains (line 42) | def contains(self, obj): method get_first (line 53) | def get_first(self): method get_last (line 59) | def get_last(self): method add_first (line 65) | def add_first(self, obj): method add_last (line 72) | def add_last(self, obj): method remove_first (line 79) | def remove_first(self): method remove_last (line 85) | def remove_last(self): method _check_index (line 91) | def _check_index(self, index, raise_error=False): method __iter__ (line 117) | def __iter__(self): method set (line 121) | def set(self, obj, index=-1): method get (line 130) | def get(self, index=-1): method add (line 138) | def add(self, obj, index=-1): method add_all (line 147) | def add_all(self, objs, index=-1): method remove (line 157) | def remove(self, index=-1): method index (line 165) | def index(self, obj): method last_index (line 175) | def last_index(self, obj): method clear (line 185) | def clear(self): method clone (line 192) | def clone(self): method sort (line 199) | def sort(self, key=None): method _get_size (line 207) | def _get_size(self): method _get_node (line 214) | def _get_node(self, index=-1): FILE: topic/linked_list/python/cyclic_doubly_list.py class CyclicDoublyList (line 7) | class CyclicDoublyList(ListBase): method __init__ (line 8) | def __init__(self): method __iter__ (line 11) | def __iter__(self): method set (line 19) | def set(self, obj, index=-1): method get (line 30) | def get(self, index=-1): method add (line 38) | def add(self, obj, index=-1): method add_all (line 59) | def add_all(self, objs, index=-1): method remove (line 89) | def remove(self, index=-1): method index (line 102) | def index(self, obj): method last_index (line 120) | def last_index(self, obj): method clear (line 138) | def clear(self): method clone (line 147) | def clone(self): method sort (line 153) | def sort(self, key=None): method _get_size (line 160) | def _get_size(self): method _get_node (line 166) | def _get_node(self, index=-1): method _new_node (line 186) | def _new_node(self, obj, pre=None, nxt=None): FILE: topic/linked_list/python/cyclic_list.py class CyclicList (line 9) | class CyclicList(ListBase): method __init__ (line 10) | def __init__(self): method __iter__ (line 13) | def __iter__(self): method set (line 21) | def set(self, obj, index=-1): method get (line 32) | def get(self, index=-1): method add (line 40) | def add(self, obj, index=-1): method add_all (line 61) | def add_all(self, objs, index=-1): method remove (line 89) | def remove(self, index=-1): method index (line 102) | def index(self, obj): method last_index (line 120) | def last_index(self, obj): method clear (line 143) | def clear(self): method clone (line 152) | def clone(self): method sort (line 158) | def sort(self, key=None): method _get_size (line 165) | def _get_size(self): method _get_node (line 171) | def _get_node(self, index=-1): method _get_prev_node (line 193) | def _get_prev_node(self, index=-1): method _new_node (line 217) | def _new_node(self, obj, nxt=None): FILE: topic/linked_list/python/dummy_tail_doubly_list.py class DummyTailDoublyList (line 8) | class DummyTailDoublyList(ListBase): FILE: topic/linked_list/python/dummy_tail_list.py class DummyTailList (line 8) | class DummyTailList(ListBase): FILE: topic/linked_list/python/head_tail_doubly_list.py class HeadTailDoublyList (line 8) | class HeadTailDoublyList(ListBase): FILE: topic/linked_list/python/head_tail_list.py class HeadTailList (line 8) | class HeadTailList(ListBase): FILE: topic/linked_list/python/linked_list__test.py class TestLinkedList (line 5) | class TestLinkedList(TestBase): method _get_instance (line 6) | def _get_instance(self, LinkedList): method _test_set (line 19) | def _test_set(self, LinkedList): method _test_get (line 39) | def _test_get(self, LinkedList): method _test_add (line 58) | def _test_add(self, LinkedList): method _test_add_all (line 82) | def _test_add_all(self, LinkedList): method _test_remove (line 111) | def _test_remove(self, LinkedList): method _test_contains (line 134) | def _test_contains(self, LinkedList): method _test_index (line 146) | def _test_index(self, LinkedList): method _test_last_index (line 152) | def _test_last_index(self, LinkedList): method _test_clear (line 158) | def _test_clear(self, LinkedList): method _test_clone (line 167) | def _test_clone(self, LinkedList): method _test_sort (line 170) | def _test_sort(self, LinkedList): method _run_list_test (line 173) | def _run_list_test(self, LinkedList): method test_cyclic_list (line 186) | def test_cyclic_list(self): method test_cyclic_doubly_list (line 189) | def test_cyclic_doubly_list(self): FILE: topic/linked_list/python/two_dummy_doubly_list.py class TwoDummyDoublyList (line 7) | class TwoDummyDoublyList(ListBase): FILE: topic/linked_list/python/two_dummy_list.py class TwoDummyList (line 7) | class TwoDummyList(ListBase): FILE: topic/searching/python/_helper.py class SearchBase (line 4) | class SearchBase(ABC): method search (line 7) | def search(cls, iterable, val): FILE: topic/sorting/python/_helper.py class SortBase (line 5) | class SortBase(ABC): method sort (line 8) | def sort(cls, iterable): method _is_valid_payload (line 16) | def _is_valid_payload(iterable): FILE: topic/sorting/python/merge_sort.py class MergeSort (line 4) | class MergeSort(SortBase): method sort (line 6) | def sort(cls, iterable): method _divide_conquer (line 20) | def _divide_conquer(cls, arr, start, end, tmp): FILE: topic/sorting/python/quick_sort.py class QuickSort (line 4) | class QuickSort(SortBase): method sort (line 11) | def sort(cls, iterable): method _divide_conquer (line 25) | def _divide_conquer(cls, arr, start, end): FILE: topic/sorting/python/sorting__test.py class TestSorting (line 5) | class TestSorting(TestBase): method _run_sorting_test (line 18) | def _run_sorting_test(self, Sort): method test_quick_sort (line 27) | def test_quick_sort(self): method test_merge_sort (line 30) | def test_merge_sort(self): FILE: topic/traversal/python/_helper.py class TraversalBase (line 4) | class TraversalBase(ABC): method preorder_traverse (line 7) | def preorder_traverse(cls, root, callback=None): method inorder_traverse (line 17) | def inorder_traverse(cls, root, callback=None): method postorder_traverse (line 27) | def postorder_traverse(cls, root, callback=None): FILE: topic/traversal/python/binary_tree_traversal__test.py class TestBinaryTreeTraversal (line 6) | class TestBinaryTreeTraversal(TestBase): method setUp (line 22) | def setUp(self): method _run_traversal_test (line 30) | def _run_traversal_test(self, Traversal): method test_recursive_traversal (line 46) | def test_recursive_traversal(self): method test_iterative_traversal (line 49) | def test_iterative_traversal(self): method test_morris_traversal (line 52) | def test_morris_traversal(self): FILE: topic/traversal/python/iterative_traversal.py class IterativeTraversal (line 4) | class IterativeTraversal(TraversalBase): method preorder_traverse (line 6) | def preorder_traverse(cls, root, callback=None): method inorder_traverse (line 25) | def inorder_traverse(cls, root, callback=None): method postorder_traverse (line 44) | def postorder_traverse(cls, root, callback=None): FILE: topic/traversal/python/morris_traversal.py class MorrisTraversal (line 5) | class MorrisTraversal(TraversalBase): method preorder_traverse (line 11) | def preorder_traverse(cls, root, callback=None): method inorder_traverse (line 39) | def inorder_traverse(cls, root, callback=None): method postorder_traverse (line 67) | def postorder_traverse(cls, root, callback=None): method _postorder_reverse_visit (line 98) | def _postorder_reverse_visit(cls, from_node, to_node, callback): method _postorder_reverse (line 111) | def _postorder_reverse(cls, from_node, to_node): FILE: topic/traversal/python/recursive_traversal.py class RecursiveTraversal (line 4) | class RecursiveTraversal(TraversalBase): method preorder_traverse (line 6) | def preorder_traverse(cls, root, callback=None): method inorder_traverse (line 20) | def inorder_traverse(cls, root, callback=None): method postorder_traverse (line 34) | def postorder_traverse(cls, root, callback=None): FILE: topic/tree/python/binary_tree.py class TreeNode (line 1) | class TreeNode: method __init__ (line 2) | def __init__(self, val): class BinaryTree (line 7) | class BinaryTree: method serialize (line 12) | def serialize(cls, root): method deserialize (line 38) | def deserialize(cls, data): FILE: topic/tree/python/binary_tree__test.py class TestBinaryTree (line 5) | class TestBinaryTree(TestBase): method test_serialization (line 6) | def test_serialization(self): FILE: topic/tree/python/trie.py class TrieNode (line 4) | class TrieNode: method __init__ (line 5) | def __init__(self): class Trie (line 10) | class Trie: method __init__ (line 11) | def __init__(self): method __repr__ (line 14) | def __repr__(self): method put (line 17) | def put(self, word): method has_word (line 28) | def has_word(self, word): method has_prefix (line 34) | def has_prefix(self, word): method get_node (line 40) | def get_node(self, char, node=None): method _search (line 47) | def _search(self, word): method _is_str (line 61) | def _is_str(self, word): FILE: topic/tree/python/trie__test.py class TestTrie (line 5) | class TestTrie(TestBase): method test_init (line 6) | def test_init(self): method test_put (line 16) | def test_put(self): method test_has_word_or_prefix (line 35) | def test_has_word_or_prefix(self): method test_invalid_put (line 73) | def test_invalid_put(self):