A collection of my solutions while following the Coding Interview Roadmap by DesignGurus.io.
This repository contains my implementations, notes, and explanations for algorithms, data structures, and problem-solving patterns covered in the roadmap. It aligns with the course’s focus on mastering core concepts through a combination of theory and hands-on coding challenges.
- Strengthen problem-solving skills
- Understand and apply common coding patterns
- Prepare efficiently for technical interviews
- Track personal progress through organized, topic-based solutions
📂 .
├── 📁 01-data-structures-and-algorithms
│ ├── 📁 01-array
│ │ ├── 01.running_sum_of_1d_array.py
│ │ ├── 02.contains_duplicate.py
│ │ ├── 03.left_and_right_sum_differences.py
│ │ └── 04.find_the_highest_altitude.py
│ ├── 📁 02-matrix
│ │ ├── 01.richest_customer_wealth.py
│ │ ├── 02.matrix_diagonal_sum.py
│ │ └── 03.row_with_maximum_ones.py
│ ├── 📁 03-stack
│ │ ├── 01.valid_parentheses.py
│ │ ├── 02.reverse_string.py
│ │ ├── 03.decimal_to_binary_conversion.py
│ │ ├── 04.next_greater_element.py
│ │ ├── 05.sorting_stack.py
│ │ ├── 06.simplify_path.py
│ │ ├── 07.remove_all_adjacent_duplicates_in_string.py
│ │ ├── 08.removing_stars_from_a_string.py
│ │ └── 09.make_the_string_great.py
│ ├── 📁 04-queue
│ ├── 📁 05-linked-list
│ │ ├── 01.reverse_linked_list.py
│ │ ├── 02.remove_duplicates_from_sorted_list.py
│ │ ├── 03.merge_two_sorted_lists.py
│ │ ├── 04.check_doubly_linked_list_characters_palindrome.py
│ │ └── 05.swap_nodes_in_pairs.py
│ ├── 📁 06-tree-and-binary-search-tree
│ ├── 📁 07-hash-table
│ ├── 📁 08-hash-set
│ ├── 📁 09-heap
│ │ ├── 01.take_gifts_from_the_richest_pile.py
│ │ ├── 02.sort_characters_by_frequency.py
│ │ ├── 03.minimum_cost_to_connect_sticks.py
│ │ └── 04.find_median_from_data_stream.py
│ ├── 📁 10-graph
│ │ ├── 01.find_if_path_exists_in_graph.py
│ │ ├── 02.number_of_provinces.py
│ │ ├── 03.find_eventual_safe_states.py
│ │ ├── 04.minimum_number_of_vertices_to_reach_all_nodes.py
│ │ └── 05.bus_routes.py
│ ├── 📁 11-trie
│ ├── 📁 12-sorting
│ │ ├── 01.apple_redistribution_into_boxes.py
│ │ ├── 02.sort_array_by_increasing_frequency.py
│ │ ├── 03.sort_vowels_in_a_string.py
│ │ ├── 04.reduction_operations_to_make_the_array_elements_equal.py
│ │ ├── 05.divide_array_into_arrays_with_max_difference.py
│ │ ├── 06.top_k_frequent_elements.py
│ │ └── 07.meeting_rooms-ii.py
│ ├── 📁 13-searching
│ │ ├── 01.maximum_count_of_positive_integer_and_negative_integer.py
│ │ ├── 02.minimum_common_value.py
│ │ ├── 03.frequency_of_the_most_frequent_element.py
│ │ ├── 04.minimize_the_maximum_of_two_arrays.py
│ │ ├── 05.search_a_2d_matrix_ii.py
│ │ └── 06.sqrtx.py
│ ├── 📁 14-greedy-algorithm
│ │ ├── 01.valid_palindrome_ii.py
│ │ ├── 02.maximum_length_of_pair_chain.py
│ │ ├── 03.minimum_add_to_make_parentheses_valid.py
│ │ ├── 04.remove_duplicate_letters.py
│ │ ├── 05.largest_palindromic_number.py
│ │ └── 06.removing_minimum_and_maximum_from_array.py
│ ├── 📁 15-divide-and-conquer
│ │ ├── 01.longest_nice_substring.py
│ │ └── 02.majority_element.py
├── 📁 02-art-of-recursion
├── 📁 03-common-coding-patterns
│ ├── 📁 01-warm-up
│ │ ├── 01.contains_duplicate.py
│ │ ├── 02.check_if_the_sentence_is_pangram.py
│ │ ├── 03.reverse_vowels_of_a_string.py
│ │ ├── 04.valid_palindrome.py
│ │ ├── 05.valid_anagram.py
│ │ ├── 06.shortest-word-distance.py
│ │ ├── 07.number_of_good_pairs.py
│ │ └── 08.sqrtx.py
│ ├── 📁 02-two-pointers
│ │ ├── 01.pair_with_target_sum.py
│ │ ├── 02.remove_duplicates_from_sorted_array.py
│ │ ├── 03.squares_of_a_sorted_array.py
│ │ ├── 04.3sum.py
│ │ ├── 05.3sum_closest.py
│ │ ├── 06.3sum_smaller.py
│ │ ├── 07.sort_colors.py
│ │ ├── 08.4sum.py
│ │ ├── 09.backspace_string_compare.py
│ │ └── 10.shortest_unsorted_continuous_subarray.py
│ ├── 📁 03-fast-and-slow-pointers
│ │ ├── 01.linked_list_cycle.py
│ │ ├── 02.middle_of_the_linked_list.py
│ │ ├── 03.linked_list_cycle_ii.py
│ │ ├── 04.happy_number.py
│ │ ├── 05.palindrome_linked_list.py
│ │ └── 06.reorder_list.py
│ ├── 📁 04-sliding-window
│ │ ├── 01.maximum_sum_subarray_of_size_k.py
│ │ ├── 02.minimum_size_subarray_sum.py
│ │ ├── 03.longest_substring_with_at_most_k_distinct_characters.py
│ │ ├── 04.fruit_into_baskets.py
│ │ ├── 05.longest_repeating_character_replacement.py
│ │ ├── 06.max_consecutive_ones_iii.py
│ │ ├── 07.permutation_in_string.py
│ │ ├── 08.find_all_anagrams_in_a_string.py
│ │ ├── 11.subarray_product_less_than_k.py
│ │ └── 12.list_of_subarrays_product_less_than_k.py
│ ├── 📁 05-merge-intervals
│ │ ├── 01.merge_intervals.py
│ │ ├── 02.insert_interval.py
│ │ ├── 03.interval_list_intersections.py
│ │ ├── 04.meeting_room_i.py
│ │ ├── 05.meeting_rooms_ii.py
│ │ ├── 06.maximum_cpu_load.py
│ │ └── 07.employee_free_time.py
│ ├── 📁 06-cyclic-sort
│ │ ├── 01.cyclic_sort.py
│ │ ├── 02.missing_number.py
│ │ ├── 03.find_all_numbers_disappeared_in_an_array.py
│ │ ├── 04.find_the_duplicate_number.py
│ │ ├── 05.find_all_duplicates_in_an_array.py
│ │ ├── 06.find_the_corrupt_one.py
│ │ ├── 07.first_missing_positive.py
│ │ └── 08.first_k_missing_positive.py
│ ├── 📁 07-in-place-reversal-of-linked-list
│ │ ├── 01.reverse_linked_list.py
│ │ ├── 02.reverse_linked_list_ii.py
│ │ └── 05.rotate_linked_list.py
│ ├── 📁 08-stack
│ │ ├── 01.valid_parentheses.py
│ │ ├── 02.reverse_string.py
│ │ ├── 03.decimal_to_binary_conversion.py
│ │ ├── 04.next_greater_element.py
│ │ ├── 05.sorting_stack.py
│ │ ├── 06.simplify_path.py
│ │ ├── 07.remove_all_adjacent_duplicates_in_string.py
│ │ ├── 08.removing_stars_from_a_string.py
│ │ └── 09.make_the_string_great.py
│ ├── 📁 09-monotonic-stack
│ │ ├── 01.remove_nodes_from_linked_list.py
│ │ ├── 02.remove_all_adjacent_duplicates_in_string.py
│ │ ├── 03.next_greater_element_i.py
│ │ ├── 04.daily_temperatures.py
│ │ ├── 05.remove_all_adjacent_duplicates_in_string_ii.py
│ │ ├── 06.sum_of_subarray_minimums.py
│ │ └── 07.remove_k_digits.py
│ ├── 📁 10-hash-map
│ ├── 📁 11-level-order-traversal
│ │ ├── 01.binary_tree_level_order_traversal_ii.py
│ │ ├── 02.find_largest_value_in_each_tree_row.py
│ │ ├── 03.maximum_width_of_binary_tree.py
│ │ ├── 04.maximum_level_sum_of_a_binary_tree.py
│ │ ├── 05.binary_tree_zigzag_level_order_traversal.py
│ │ ├── 06.even_odd_tree.py
│ │ └── 07.n_ary_tree_level_order_traversal.py
│ ├── 📁 12-tree-breadth-first-search
│ │ ├── 01.binary_tree_level_order_traversal.py
│ │ ├── 02.binary_tree_level_order_traversal_ii.py
│ │ ├── 03.binary_tree_zigzag_level_order_traversal.py
│ │ ├── 04.average_of_levels_in_binary_tree.py
│ │ ├── 05.minimum_depth_of_binary_tree.py
│ │ ├── 06.level_order_successor.py
│ │ ├── 07.populating_next_right_pointers_in_each_node.py
│ │ ├── 08.connect_all_level_order_siblings.py
│ │ └── 09.binary_tree_right_side_view.py
│ ├── 📁 13-tree-depth-first-search
│ │ ├── 01.path_sum.py
│ │ ├── 02.path_sum_ii.py
│ │ ├── 03.sum_root_to_leaf_numbers.py
│ │ ├── 04.check_if_a_string_is_a_valid_sequence_from_root_to_leaves_path.py
│ │ ├── 05.path_sum_iii.py
│ │ ├── 06.diameter_of_binary_tree.py
│ │ └── 07.binary_tree_maximum_path_sum.py
│ ├── 📁 14-graph
│ │ ├── 01.find_if_path_exists_in_graph.py
│ │ ├── 02.number_of_provinces.py
│ │ ├── 03.find_eventual_safe_states.py
│ │ ├── 04.minimum_number_of_vertices_to_reach_all_nodes.py
│ │ └── 05.bus_routes.py
│ ├── 📁 15-island-matrix-traversal
│ │ ├── 01.number_of_islands.py
│ │ ├── 02.max_area_of_island.py
│ │ ├── 03.flood_fill.py
│ │ ├── 04.number_of_closed_islands.py
│ │ ├── 05.island_perimeter.py
│ │ ├── 06.number_of_distinct_islands.py
│ │ └── 07.detect_cycles_in_2d_grid.py
│ ├── 📁 16-two-heaps
│ │ ├── 01.find_median_from_data_stream.py
│ │ └── 04.find_right_interval.py
│ ├── 📁 17-subset
│ │ ├── 01.subsets.py
│ │ ├── 02.subsets_ii.py
│ │ ├── 03.permutations.py
│ │ ├── 04.letter_case_permutation.py
│ │ └── 05.generate_parentheses.py
│ ├── 📁 18-modified-binary-search
│ ├── 📁 19-bitwise-xor
│ ├── 📁 20-top-k-elements
│ ├── 📁 21-k-way-merge
│ ├── 📁 22-greedy-algorithm
│ ├── 📁 23-dp-0-or-1-knapsack
│ ├── 📁 24-dp-fibonacci-number
│ ├── 📁 25-dp-palindromic-subsequence
│ ├── 📁 26-backtracking
│ ├── 📁 27-trie
│ ├── 📁 28-graph-topological-sort
│ ├── 📁 29-union-find
│ ├── 📁 30-ordered-set
│ ├── 📁 31-prefix-sum
│ ├── 📁 32-multi-threading
├── 📁 04-advanced-coding-patterns
├── 📁 05-dynamic-programming
│ ├── 📁 01-0-or-1-knapsack
│ ├── 📁 02-unbounded-knapsack
│ ├── 📁 03-fibonacci-numbers
│ ├── 📁 04-palindromic-subsequence
│ ├── 📁 05-longest-common-substring
├── LICENSE
├── README.md
└── directory_layout_script.py