文件名称:leetcode2sumc-CTCI:CTCI
文件大小:40KB
文件格式:ZIP
更新时间:2024-07-20 11:35:12
系统开源
leetcode 2 和 c CTCI 回溯总结: 组合和、子集、排列、回文) 组合和 def combinationSum ( self , candidates , target ): def backtrack ( tmp , start , end , target ): if target == 0 : ans . append ( tmp [:]) elif target > 0 : for i in range ( start , end ): tmp . append ( candidates [ i ]) backtrack ( tmp , i , end , target - candidates [ i ]) tmp . pop () ans = [] candidates . sort ( reverse = True ) backtrack ([], 0 , len ( candidates ), target ) return ans 组合和II def combinationSum2 ( self , candidates , target ): def
【文件预览】:
CTCI-master
----Sorting()
--------mergesort.py(2KB)
--------quick_sort.py(1KB)
----LeetCode()
--------maximum_subarray.py(910B)
--------palindrome_partitioning_131.py(1KB)
--------house_robber.py(604B)
--------binary_tree_level_order_traversal_ii_107.py(976B)
--------longest_substring_without_repeating_characters.py(1KB)
--------copy_list_with_random_pointer_138.py(1KB)
--------permutation_sequence_60.py(1KB)
--------unique_binary_search_tree.py(2KB)
--------maximum_size_subarray_sum_equals_k_325.py(1KB)
--------single_number_iii_260.py(802B)
--------generate_parenthesis.py(1KB)
--------move_zeroes.py(1012B)
--------combinations.py(471B)
--------k_closest_points_to_origin.py(2KB)
--------rotting_oranges.py(3KB)
--------meeting_rooms_ii.py(501B)
--------word_search_79.py(3KB)
--------symetric_tree_101.py(1KB)
--------mininum_window_substring.py(1KB)
--------word_break_139.py(1KB)
--------sqrt_of_x.py(1KB)
--------permutations_46.py(729B)
--------3_sum.py(1KB)
--------longest_common_subsequence.py(2KB)
--------valid_soduku.py(4KB)
--------valid_word_abbreviation.py(827B)
--------rotten_oranges.py(2KB)
--------permutationsII_47.py(1KB)
--------kth_largest_element_in_array_79.py(1KB)
--------vailidate_binary_search_tree_97.py(2KB)
--------cut_off_trees_for_golf_event.py(3KB)
--------string_to_integer.py(3KB)
--------matrix_rotate_48.py(1KB)
--------average_of_levels_in_binary_tree_637.py(810B)
--------minimum_absolute_difference_bst.py(1KB)
--------k_concatenation_maximum_sum.py(892B)
--------subsets_78.py(1KB)
--------allPathsFromSourceToTarget.py(1KB)
--------top_k_frequent_elements.py(800B)
----Interview()
--------hairSalonSimulation.py(12KB)
--------Microsoft()
--------question.py(1KB)
----GeneralApproachToBackTracking()
--------coin_change.py(1KB)
--------combination_sum.py(665B)
--------subsets.py(581B)
--------permutations.py(552B)
----Moderate()
--------instersection_16.3.py(131B)
--------smallest_difference_16.6.py(1KB)
--------word_frequencies_16.2.py(490B)
--------number_swapper_16.1.py(276B)
--------subsort_16.16.py(2KB)
----README.md(6KB)
----.gitignore(9B)
----permutation_witout_dups_8_7.py(676B)