Skip to content

echobash/30_days_of_data_structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Practice Playground ✨

Welcome! This repository is my personal collection of Python code, focusing on algorithms, data structures, Object-Oriented Programming (OOP), Low-Level Design (LLD), and solutions to various coding challenges (primarily LeetCode). It serves as a space for learning, practice, and demonstrating problem-solving approaches.

Navigation: Use the Table of Contents below or expand the collapsible sections to explore different categories.

Table of Contents


Project Index

Click the <summary> tags to expand/collapse the detailed file lists for each category.

Low-Level Design (LLD) 🎨 (6 items)
Program Name Location Status Notes
Design Stack Overflow (Conceptual) LLD/Design Stackoverflow/ Done Basic structure files
Basic Class Example LLD/Oops/class.py Done
Payment Interface Example (Interface/ABC) LLD/Oops/interface_and_abc/payments_example/ Done Demonstrates interface concept
Vehicle Interface Example (Interface/ABC) LLD/Oops/interface_and_abc/vehicles_example/ Done Demonstrates interface concept
Tic Tac Toe (Requirement Gathering Conceptual) LLD/Tic Tac Toe/Requirement Gathering Done Text description
Tic Tac Toe Implementation LLD/Tic Tac Toe/tic_tac_toe.py Done
Maths πŸ“ (47 items)
Program Name Location Status Notes (LeetCode #)
Is Palindrome (Integer Overflow Avoidance) is_a_no_palindrome_bruteforce_to_avoid_integer_overflow.py Done 9 - Variation
Is Palindrome (Compare MSB/LSB) is_a_no_palindrome_by_comparing_lsb_and_msb_and_chopping_them_both.py Done 9 - Variation
Is Palindrome (Optimized Integer) is_a_no_palindrome_optimized.py Done 9
Is Palindrome (Integer Overflow Prone) is_a_no_palindrome_prone_to_integer_overflow.py Done 9 - Variation
Is Palindrome (String Reverse) is_a_no_palindrome_using_string_and_reversing_complete_string.py Done 9 - Variation
Is Palindrome (String Two Pointer) is_a_no_palindrome_using_string_and_using_two_pointer.py Done 9 - Variation
Arithmetic Subarrays (Bruteforce) arithmetic_subarrays_1630_bruteforce.py Done 1630
Arithmetic Subarrays (Optimized) arithmetic_subarrays_1630_optimized_without_sorting.py Done 1630
Avg Values of Even Nos Divisible by Three avg_values_of_even_nos_that_are_divisible_by_three_2455.py Done 2455
Base 7 base_7_504.py Done 504
Check If No is Sum of Power of Three check_if_no_is_sum_of_power_of_three_1780.py Done 1780
Check If the No is Fascinating check_if_the_no_is_fascinating_2729.py Done 2729
Closest Prime Numbers in Range (TLE Likely) closest_prime_no_in_ranges_2523.py Done 2523
Closest Prime Numbers in Range (Optimized Sieve) closest_prime_no_in_ranges_2523_n*sqrt(n).py Done 2523
Color of Chessboard Square color_of_chessboard_1812.py Done 1812
Complex Number Multiplication complex_no_multiplication_537.py Done 537
Count Digits count_no_of_digits.py Done
Count Digits (Optimized Log) count_no_of_digits_optimized.py Done
Count Primes (Bruteforce) count_primes_204_bruteforce_n_*_sqrt(n).py Done 204
Count Primes (Sieve of Eratosthenes) count_primes_204_sieve_of_eratosthenes..py Done 204
Count Symmetrical Integers count_symmetrical_integers_2843.py Done 2843
Difference Between Element Sum and Digit Sum difference_betwen_element_sum_and_digit_sum_2535.py Done 2535
Fibonacci Number fibonacii_number_509.py Done 509
Find GCD of Array find_gcd_of_array_1979.py Done 1979
Find if Digits Can be Won (Typo?) find_if_digits_can_be_won_3232.py Done (Typo? Needs check)
Find the Difference (XOR) find_the_difference_using_xor_389.py Done 389
Find the Pivot Integer find_the_pivot_integer_2485.py Done 2485
GCD Implementation gcd.py Done
Harshad Number harshad_no_3099.py Done 3099
Is Armstrong Number is_armstrong_no.py Done
Is Prime (Optimized) is_prime_optimized.py Done
Is Ugly is_ugly_263.py Done 263
Max Sum of Pair with Equal Digit Sum (Bruteforce) max_sum_of_a_pair_with_equal_sum_of_digits_2342_bruteforce_quadratic.py Done 2342
Max Sum of Pair with Equal Digit Sum (Hashing) max_sum_of_a_pair_with_equal_sum_of_digits_2342_linear_time_hashing.py Done 2342
Number After Double Reversal (Modulo) no_after_double_reversal_2119_modulous.py Done 2119
Number of 1 Bits (Hamming Weight) no_of_1_bits_191_logn.py Done 191
Number of Common Factors no_of_common_factors_2427.py Done 2427
Number of Steps to Reduce a Number to Zero no_of_steps_to_reduce_a_no_to_zero.py Done 1342
Print All Divisors print_all_divisors.py Done
Reverse a Number reverse_a_no.py Done 7
Set Mismatch (Using Math) set_mismatch_645_using_math.py Done 645
Sieve of Eratosthenes Implementation sieve_of_eratosthenes.py Done
Single Element in a Sorted Array (Bruteforce) singleNonDuplicate540.py Done 540
Single Element in a Sorted Array (Binary Search) singleNonDuplicate540_binary_search.py Done 540
Square Root (Bruteforce) square_root_of_a_no_69_bruteforce_sqrt_time_complexity.py Done 69
Subtract Product and Sum of Digits subtact_prod_and_sum_of_digits_of_a_no_1281.py Done 1281
Sum Multiples sum_multiples_2652.py Done 2652
Sum Multiples (Optimized O(1)) sum_multiples_2652_optimized.py Done 2652
The Kth Factor of N the_kth_factor_of_n_1492.py Done 1492
Three Divisors (Linear Time) three_divisors_linear_time_1952.py Done 1952
Three Divisors (Optimized Prime Check) three_divisors_optimized_using_prime_no_1952.py Done 1952
Water Bottles water_bodies_1518.py Done 1518
XOR Operation in an Array xor_operation_in_array_1486.py Done 1486
Patterns πŸ–ΌοΈ (11 items)
Program Name Location Status
Decreasing Stars Pyramid decreasing_stars_top_to_bottom_pyramid.py Done
Diamond Pattern diamond.py Done
Half Diamond Pattern halfdiamond.py Done
Numbers Pyramid numbers_top_to_bottom_pyramid.py Done
Numbers Pyramid (Alternative) numbers_top_to_bottom_pyramid_alternative_solution.py Done
Numbers Pyramid (Row No Repeat) numbers_top_to_bottom_pyramid_row_no_repeat.py Done
Stars Square Pattern stars_square_pattern.py Done
Stars Pyramid stars_top_to_bottom_pyramid.py Done
Christmas Tree xmastree.py Done
Inverted Christmas Tree xmastree_inverted.py Done
Sorting β‡… (28 items)
Program Name Location Status Notes (LC #)
Bubble Sort bubble_sort.py Done
Count Smaller Numbers (Bruteforce) count_no_smaller_than_current_no_bruteforce_1365.py Done 1365
Count Smaller Numbers (Optimized/Sorting) count_no_smaller_than_current_no_optimized_1365.py Done 1365
Find Target Indices After Sorting find_target_indices_after_sorting_2089.py Done 2089
Find the Difference (Sorting) find_the_difference_using_sorting_389.py Done 389
Find Integer Added to Array I find_the_integer_added_to_array_I_3131_sorting.py Done 3131
Height Checker height_checker_1051.py Done 1051
Insertion Sort insert_sort.py Done
Maximum Number of Coins You Can Get maximum_no_of_coins_you_can_get_1561.py Done 1561
Max Prod Diff (Find Max/Min) maximum_product_difference_between_two_pairs_by_finding_two_max_and_two_mins_1913.py Done 1913
Max Prod Diff (Sorting) maximum_product_difference_between_two_pairs_using_sorting_1913.py Done 1913
Max Prod of Two Elements (Linear) maximum_product_of_two_elements_in_an_array_1464_optimized_linear_traversal.py Done 1464
Max Prod of Two Elements (Sorting) maximum_product_of_two_elements_in_an_array_1464_sorting.py Done 1464
Merge Two 2D Arrays (Hashing + Sorting) merge_two_2D_arrays_by_summing_values_2570_linear_space_hashing_and_sorting.py Done 2570
Minimum Average of Smallest and Largest minimum_average_of_smallest_and_largest_elements_3194.py Done 3194
Minimum Number Game minimum_number_game_2974.py Done 2974
Minimum Sum of Four Digit No After Splitting mininum_sum_of_four_digit_no_after_splitting_digits_2160.py Done 2160
Selection Sort selection_sort.py Done
Sort Array By Parity (Extra Space) sort_array_by_parity_905_extra_space.py Done 905
Sort Array By Parity (In-place) sort_array_by_parity_905_no_extra_space.py Done 905
Sort Binary Array sort_binary_array.py Done (Similar to 75)
Sort Colors (Counting Sort) sort_colors_counting_sort_75.py Done 75
Sorting the Sentence (Bruteforce) sorting_the_sentence_1859_bruteforce.py Done 1859
Sorting the Sentence (Hashing) sorting_the_sentence_1859_optimized_hashing.py Done 1859
Sorting the Sentence (Sorting) sorting_the_sentence_1859_optimized_sorting.py Done 1859
Third Maximum Number third_maximum_no_414.py Done 414
Widest Vertical Area Between Two Points widest_vertical_area_in_graph_1637.py Done 1637
Array πŸ”’ (60 items)
Program Name Location Status Notes (LC #)
Apply Operations on an Array (Extra Space) apply_operations_on_an_array_2460_extra_space.py Done 2460
Apply Operations on an Array (Constant Space) apply_operations_on_an_array_2460_optimized_constant_space.py Done 2460
Build Array from Permutation build_array_from_permutation_1920.py Done 1920
Capacity To Ship Packages (Bruteforce) capacity_to_ship_packages_within_d_days_1011_bruteforce_quadratic_time.py Done 1011
Categorize Box categorize_box_2525.py Done 2525
Check If Array Is Sorted and Rotated (Bruteforce) check_if_array_is_sorted_and_rotated_1752_bruteforce_quadratic_time.py Done 1752
Check If Array Is Sorted and Rotated (Optimized) check_if_array_is_sorted_and_rotated_1752_optimized_linear_time.py Done 1752
Check If N and Its Double Exist check_if_n_and_its_double_exist_1346.py Done 1346
Count Items Matching a Rule count_items_matching_a_rule_1773.py Done 1773
Count Negative Numbers in Sorted Matrix (Bruteforce) count_negative_no_in_a_sorted_array_1351_bruteforce.py Done 1351
Count Number of Bad Pairs (Bruteforce) count_no_of_bad_pairs_bruteforce_2364_quadratic_time.py Done 2364
Count Pairs That Form a Complete Day I (Bruteforce) count_pairs_that_form_a_complete_day_1_3184_bruteforce.py Done 3184
Count Pairs With Sum Less Than Target count_pairs_with_sum_less_than_target.py Done 2824
Count Subarrays of Length Three (Placeholder) count_subarrays_of_length_three_with_condition.py Done (Needs LC #?)
Decompress Run-Length Encoded List decompress_run_length_encoded_list_1313.py Done 1313
Find the Difference Between Two Arrays difference_between_two_arrays_2215.py Done 2215
Divide Array Into Equal Pairs (Using Array Counts) divide_array_into_equal_parts_2206_using_array.py Done 2206
Final Prices With Discount final_price_with_discount_1475.py Done 1475 - Stack
Final Value After Performing Operations final_value_after_performing_operations_2011.py Done 2011
Find Lucky Integer in an Array find_lucky_integer_in_an_array_1394.py Done 1394
Find Minimum in Rotated Sorted Array (Linear) find_minimum_in_rotated_sorted_array_153_bruteforce_linear_time.py Done 153
Find Missing and Repeating No (Bruteforce) find_missing_and_repeating_no_2965_bruteforce_quadratic.py Done (GFG/Similar 645)
Find Peak Element (Linear) find_peak_element_162_bruteforce_linear_time_complexity.py Done 162
Find the Highest Altitude find_the_highest_altitude_1732.py Done 1732
Find Smallest Divisor Given Threshold (Bruteforce) find_the_smallest_divisor_given_a_threshold_1283_using_bruteforce.py Done 1283
Fizz Buzz fizz_buzz_412.py Done 412
Flipping an Image flipping_an_image_832.py Done 832
Intersection of Two Arrays intersection_of_two_arrays_349.py Done 349 - Set
Koko Eating Bananas (Bruteforce) koko_eating_bananas_875_bruteforce_quadratic_time.py Done 875
Kth Missing Positive Number (Linear) kth_missing_positive_no_from_sorted_array_1539.py Done 1539
Longest Inc/Dec Subarray (Bruteforce) longest_strictly_increasing_or_decreasing_array_3015_bruteforce_quadratic_time.py Done (Typo 3105?)
Matrix Diagonal Sum (Bruteforce) matrix_diagonal_sum_bruteforce_1572.py Done 1572
Matrix Diagonal Sum (Optimized) matrix_diagonal_sum_optimized_1572.py Done 1572
Max Number of Words Found in Sentences max_no_of_words_in_sentence_114.py Done 2114
Maximum Ascending Subarray Sum (Bruteforce) maximum_ascending_subarray_sum_1800_bruteforce_quadratic_time.py Done 1800
Maximum Ascending Subarray Sum (Optimized) maximum_ascending_subarray_sum_1800_optimized_linear_time.py Done 1800
Max Count of Positive and Negative (Linear) maximum_count_of_positive_and_negative_integers_2529_bruteforce_linear.py Done 2529
Merge Strings Alternately merge_strings_alternatively_1768.py Done 1768
Minimum Absolute Difference min_absolute_difference_1200.py Done 1200 - Sorting
Minimum Index Sum of Two Lists min_index_sum_of_two_lists_599.py Done 599 - Hashing
Min No of Days to Make M Bouquets (Bruteforce) min_no_of_days_to_make_m_bouquets_1482_bruteforce_quadratic_time.py Done 1482
Minimum Operations Make Columns Increasing minimum_operations_to_make_columns_strictly_increasing_3402.py Done (Typo?)
Minimum Cuts to Divide a Circle mininum_cuts_to_divide_a_circle_2481.py Done 2481
Neither Minimum nor Maximum (Linear Space) neither_minimum_nor_maximum_2733_linear_space.py Done 2733
Neither Minimum nor Maximum (Constant Space) neither_minimum_nor_maximum_2733_optimized_constant_space.py Done 2733
Number of Employees Who Met the Target no_of_employees_who_meet_the_target_2798.py Done 2798
Number of Pairs with Absolute Difference K no_of_pair_with_absolute_difference_k.py Done 2006
Number of Pairs with Sum K no_of_pair_with_sum_k.py Done (Similar 1, 167)
Partition Array According to Pivot partition_array_according_to_given_plot_2161_linear_space.py Done 2161
Peak Index in a Mountain Array (Linear) peak_index_in_a_mountain_array_852_bruteforce_linear.py Done 852
Product of the Last K Numbers (Bruteforce) product_of_last_k_numbers_1352_bruteforce.py Done 1352
Product of the Last K Numbers (Bruteforce 2) product_of_last_k_numbers_1352_bruteforce_solution_2.py Done 1352
Product of the Last K Numbers (Prefix Product) product_of_last_k_numbers_1352_optmized_prefix_product.py Done 1352
Replace Elements with Greatest on Right replace_elements_with_greatest_element_on_right_side_1299.py Done 1299
Richest Customer Wealth richest_customer_wealth_1672.py Done 1672
Row With Maximum Ones (Bruteforce) row_with_maximum_ones_2643_bruteforce.py Done 2643
Row With Maximum Ones (Optimized) row_with_maximum_ones_2643_optimized.py Done 2643
Running Sum of 1d Array running_sum_of_1d_array_or_cummulative_sum_1480.py Done 1480
Search a 2D Matrix (Bruteforce) search_a_2d_matrix_74_bruteforce_quadratic.py Done 74
Search in Rotated Sorted Array (Linear) search_in_rotated_sorted_array_33_bruteforce_linear_time.py Done 33
Separate the Digits in an Array separate_the_digits_in_an_array_2553.py Done 2553
Set Mismatch (Using Array/Hashing) set_mismatch_645_using_array.py Done 645
Shuffle the Array shuffle_the_array_1470.py Done 1470
Special Array I special_array_3151.py Done 3151
String Matching in an Array (Bruteforce) string_matching_in_array_by_1408.py Done 1408
String Matching in an Array (Sorting) string_matching_in_array_by_sorting_1408.py Done 1408
Subrectangle Queries subrectangle_queries_1476.py Done 1476
Sum of Squares of Special Elements sum_of_squares_of_special_elements_2778.py Done 2778
Sort Array By Parity II (In-Place - Misnamed) transform_array_by_parity_3467.py Done (Typo? Rel 905/922)
Two Sum II - Input Array Is Sorted two_sum_for_given_sorted_array_167.py Done 167
Valid Sudoku valid_sudoku_36.py Done 36
Find XOR Sum of Numbers Appearing Twice xor_of_no_which_exist_twice_3158.py Done 3158
Binary Search πŸ” (23 items)
Program Name Location Status Notes (LC #)
Binary Search (Iterative Template) binary_search_704.py Done 704
Binary Search (Iterative) binary_search_iterative.py Done
Binary Search (Recursive) binary_search_recursive.py Done
Book Allocation Problem book_allocation.py Done (GFG/Famous)
Capacity To Ship Packages (Binary Search) capacity_to_ship_packages_within_d_days_1011_using_binary_search.py Done 1011
Find First and Last Position of Element find_first_and_last_occurence_of_element_34.py Done 34
Find Minimum in Rotated Sorted Array (Binary Search) find_minimum_in_rotated_sorted_array_153_binary_search.py Done 153
Find Peak Element (Binary Search) find_peak_element_162_optimized_binary_search.py Done 162
Find Smallest Divisor Given Threshold (Binary Search) find_the_smallest_divisor_given_a_threshold_1283_using_binary_search.py Done 1283
Find Upper Bound find_upper_bound_in_a_sorted_array.py Done
Find Lower Bound first_lower_bound_in_a_sorted_array.py Done
Floor and Ceiling floor_and_ceiling_of_a_sorted_array.py Done
Floor in Sorted Array floor_in_a_sorted_array.py Done
Koko Eating Bananas (Binary Search) koko_eating_bananas_875_binary_search.py Done 875
Kth Missing Positive Number (Binary Search) kth_missing_positive_no_from_sorted_array_1539_binary_search.py Done 1539
Max Count of Positive and Negative (Binary Search) maximum_count_of_positive_and_negative_integers_2529_binary_search.py Done 2529
Min No of Days to Make M Bouquets (Binary Search) min_no_of_days_to_make_m_bouquets_1482_using_binary_search.py Done 1482
Peak Index in a Mountain Array (Binary Search) peak_index_in_a_mountain_array_852_binary_search.py Done 852
Row with Maximum Ones (Binary Search) row_with_maximum_ones_row_wise_sorted_binary_search_gfg.py Done (GFG/Rel 2643)
Search a 2D Matrix (Binary Search mlogn) search_a_2d_matrix_74_bruteforce_binary_search_mlogn.py Done 74
Search a 2D Matrix (Binary Search log(m*n)) search_a_2d_matrix_74_optimized_binary_search_logm+n.py Done 74
Search in Infinite Sorted Array search_in_infinite_sorted_array.py Done (Common Prob)
Search in Rotated Sorted Array (Binary Search) search_in_rotated_sorted_array_33_binary_search.py Done 33
Search in Rotated Sorted Array II (Duplicates) search_in_rotated_sorted_array_having_duplicates_81_binary_search.py Done 81
Search Insert Position search_insert_position_35.py Done 35
Square Root (Binary Search) square_root_of_a_no_69_optimized_binary_search.py Done 69
Square Root (Binary Search Alt) square_root_of_a_no_69_optimized_binary_search_using_ans.py Done 69
Valid Perfect Square valid_perfect_square_367.py Done 367
Graph πŸ•ΈοΈ (3 items)
Program Name Location Status Notes (LC #)
Find Center of Star Graph (Optim.) find_center_of_star_graph_optimized_1791.py Done 1791
Find Center of Star Graph (Hash) find_center_of_star_graph_using_hashing1791.py Done 1791
Number of Islands no_of_islands_200.py Done 200 - DFS/BFS
Hashing πŸ”‘ (25 items)
Program Name Location Status Notes (LC #)
Common Elements Between Two Arrays common_elements_between_two_arrays_2956.py Done 2956
Contains Duplicate contains_dupilcate_217.py Done 217
Count Frequency count_frequency.php.py Done (Filename typo)
Determine if String Halves Are Alike determine_if_string_halves_are_alike_1704.py Done 1704
Divide Array Into Equal Pairs divide_array_into_equal_parts_2206.py Done 2206
Find the Difference (Hashing) find_the_difference_389.py Done 389
Find Words That Can Be Formed by Characters find_words_219.py Done 1160
Basic Hashing Function Example hashing_function.py Done
HashMap Chaining Example hashmap_chaining_to_avoid_collision.py Done
HashMap Class Example hashmap_class.py Done
Intersection of Two Arrays II intersection_of_two_arrays_II_350.py Done 350
Isomorphic Strings isomorphic_strings_205.py Done 205
Jewels and Stones (Dict) jewels_and_stones_dictionary_way_771.py Done 771
Jewels and Stones (Loops) jewels_and_stones_long_way_771.py Done 771
Jewels and Stones (Set) jewels_and_stones_using_set_771.py Done 771
Kth Distinct String in an Array kth_distinct_string_in_an_array_2053.py Done 2053
Majority Element majority_element_169.py Done 169
Merge Two 2D Arrays (Hashing) merge_two_2D_arrays_by_summing_values_2570_linear_space_hashing.py Done 2570
Min Pushes to Type Word II min_no_of_pushes_to_type_word_II_3016_hashing.py Done 3016
Minimum Steps to Make Two Strings Anagram minimum_no_of_steps_to_make_two_strings_anagram_1347.py Done 1347
Missing Number missing_number_268.py Done 268
Most Frequent/Least Frequent Element most_frequent_least_frequent_element.py Done (Custom)
Ransom Note ransom_note_383.py Done 383
Single Number single_number_136.py Done 136 - XOR better
Sum of Unique Elements sum_of_unique_elements_1748.py Done 1748
Two Sum two_sum_1.py Done 1
Valid Anagram valid_anagram_242.py Done 242
Word Pattern word_pattern_290.py Done 290
Set 🧊 (2 items)
Program Name Location Status Notes (LC #)
Greatest English Letter (Set) greatest_english_letter_in_upper_case_and_lower_case_2309_optimized_set.py Done 2309
Unique Email Addresses unique_email_address_929.py Done 929
String πŸ“œ (49 items)
Program Name Location Status Notes (LC #)
Capitalize the Title capitalize_the_title_2129.py Done 2129
Cells in Range on Excel Sheet cells_in_the_range_of_an_excel_sheet_2194.py Done 2194
Check if String Is Good (Likely Misnamed) check_balanced_string_3340.py Done (Typo? Needs check)
Check if All A's Appear Before All B's check_if_all_a's_appear_before_all_b's_2124.py Done 2124
Check if All A's Appear Before All B's (Optimized) check_if_all_a's_appear_before_all_b's_2124_optimized.py Done 2124
Check if All Characters Have Equal Occurrences check_if_all_characters_have_equal_no_of_occurences_1942.py Done 1941
Check if Numbers Are Ascending in Sentence check_if_no_are_in_ascending_order_in_a_sentence_2042.py Done 2042
Check if One Swap Makes Strings Equal (Extra Space) check_if_one_character_swap_can_make_two_strings_equal_1790_extra_space.py Done 1790
Check if One Swap Makes Strings Equal (No Extra) check_if_one_character_swap_can_make_two_strings_equal_1790_no_extra_space.py Done 1790
Check if Sentence Is Pangram check_if_sentence_is_pangram_1832.py Done 1832
Check If String Is Acronym of Words check_if_string_is_acronym_of_words_2828.py Done 2828
Check If Two String Arrays are Equivalent (BF) check_if_two_string_arrays_are_equivalent_1662_bruteforce_quadratic_because_of_list_are_immutable.py Done 1662
Check If Two String Arrays are Equivalent (Opt) check_if_two_string_arrays_are_equivalent_1662_optimized.py Done 1662
Convert Date Format (Likely Misnamed) convert_date_to_binary_3280.py Done (Typo? Needs check)
Count Prefix and Suffix Pairs I (BF) count_prefix_and_suffix_pairs_3042_bruteforce.py Done 3042
Count Vowel Strings in Ranges count_vowel_string_in_ranges_2559.py Done 2559 - Prefix Sum
Count Words With Given Prefix count_words_with_given_prefix_2185.py Done 2185
Decode the Message decode_the_message_2325.py Done 2325
Decrypt String from Alphabet to Integer Mapping decrypt_string_from_alphabet_to_integer_mapping_1309.py Done 1309
Defanging an IP Address defanging_an_ip_address_1108.py Done 1108
Faulty Keyboard faulty_keyboard_2810.py Done 2810
Find First Palindromic String in Array find_first_palindromic_string_in_array_2108.py Done 2108
Find Indices of Subarrays w/ Boundary Condition find_indices_of_stable_mountains_3285.py Done (Typo?)
Find Unique Binary String (Optimized Cantor) find_unique_binary_string_1980_optimized_cantors_diagonalization.py Done 1980
Find Unique Binary String (BF Set) find_unique_binary_string_1980_quadratic_time.py Done 1980
First Letter to Appear Twice first_letter_to_appear_twice_2351.py Done 2351 - Set
Goal Parser Interpretation goal_parser_interpretation_1678.py Done 1678
Greatest English Letter (Array/Hashing) greatest_english_letter_in_upper_case_and_lower_case_2309.py Done 2309
Calculate Digit Sum of a String (Likely Misnamed) hash_divided_string_3271.py Done (Typo? Rel 1945)
Largest Odd Number in String largest_odd_no_in_string_1903.py Done 1903
Max Nesting Depth of Parentheses max_nesting_depth_of_parantheses_1614.py Done 1614
Max Number of String Pairs (Optimized Set) max_no_of_string_pairs_2744_optimized_linear_time.py Done 2744
Max Number of String Pairs (BF) max_no_of_string_pairs_2744_quadratic_time.py Done 2744
Maximum Odd Binary Number max_odd_binary_no_2864.py Done 2864
Min Pushes to Type Word I (BF - Misnamed file) min_no_of_pushes_to_type_word_II_3016_bruteforce.py Done 3015
Number After Double Reversal (String) no_after_double_reversal_2119_string.py Done 2119
Number of Changing Keys no_of_changing_keys_3019.py Done 3019
Number of Consistent Strings no_of_consistent_string_1684.py Done 1684 - Set
Number of Pairs Concatenation Equal Target (BF) no_of_pairs_with_concatenation_equal_to_target_2023_quadratic_time.py Done 2023
Number of Senior Citizens no_of_senior_citizens_2678.py Done 2678
Percentage of Letter in String percentage_of_letter_in_string_2278.py Done 2278
Removing Trailing Zeros From a String removing_trailing_zero_from_a_string_2710.py Done 2710
String Score (Likely Misnamed) reverse_degree_of_a_string_3498.py Done (Typo? Rel 3110)
Reverse Prefix of Word reverse_prefix_of_word_2000.py Done 2000
Robot Return to Origin robot_return_to_origin_657.py Done 657
Score of a String score_of_a_string_3110.py Done 3110
Shuffle String (BF) shuffle_string_1528_bruteforce.py Done 1528
Shuffle String (Linear Extra Space) shuffle_string_1528_linear_line_extra_time_complexity.py Done 1528
Shuffle String (In-place Cycle Sort - Misnamed) shuffle_string_1528_linear_line_optimized.py Done 1528
Snake in Matrix (Likely Misnamed) snake_in_matrix_3248.py Done (Typo?)
Split Strings by Separator split_strings_by_separator_2788.py Done 2788
Strictly Palindromic Number strictly_palindromic_no_2396.py Done 2396
Sum of Digits of String After Convert sum_of_digit_of_string_after_convert_1945.py Done 1945
To Lower Case to_lower_case_709.py Done 709
Truncate Sentence truncate_sentence_1816.py Done 1816
Uncommon Words from Two Sentences uncommon_words_from_two_sentences_884.py Done 884 - Hashing
Unique Morse Code Words unique_morse_code_words_804.py Done 804 - Set
Tree 🌳 (4 items)
Program Name Location Status Notes (LC #)
Binary Tree Inorder Traversal binary_tree_inorder_traversal_94.py Done 94
Binary Tree Level Order Traversal binary_tree_level_order_traversal_102.py Done 102
Binary Tree Postorder Traversal binary_tree_postorder_traversal_94.py Done 145
Binary Tree Preorder Traversal binary_tree_preorder_traversal_144.py Done 144
Other Concepts πŸ’‘ (10 items)
Program Name Location Status Notes
Basic Loops Example Loops/loops.py Done
Factorial recursion/factorial.py Done
Fibonacci recursion/fibonacci.py Done
Max in Array (Recursion) recursion/max_in_an_array.py Done
Min in Array (Recursion) recursion/min_in_an_array.py Done
Print Reverse String (Recursion) recursion/printReverseString.py Done
Print Array (Recursion) recursion/print_elements_of_array.py Done
Print Array Reverse (Recursion) recursion/print_elements_of_array_reverse_order.py Done
Python Profiling - Bottleneck [pythonprofiling/bottleneck_checking.py](Python Concepts/Python Profiling/bottleneck_checking.py) Done Example
Python Profiling - Frequencies [pythonprofiling/call_frequencies.py](Python Concepts/Python Profiling/call_frequencies.py) Done Example
Python Profiling - Time Check [pythonprofiling/optimization_time_check.py](Python Concepts/Python Profiling/optimization_time_check.py) Done Example

How to Use

  1. Clone the repository:
    git clone <your-repo-url>
  2. Navigate: Browse the directories based on the category you're interested in (e.g., cd array).
  3. Run: Execute the Python files directly using python <filename>.py. Check individual files for any specific usage notes or required inputs.

Contributing

This repository is primarily for my personal learning and practice. However, constructive feedback, suggestions for optimizations, or bug reports are welcome! Please feel free to open an issue.


About

30 days of data structure using python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages