algorithms3 0.1.9
Data Structures and Algorithms using Python
License: MIT


Data Structures and Algorithms
==============================

This repository contains my implementations of data structures and algorithms using Python 3. Most of the algorithm questions are taken from LeetCode. This is a work in progress.

## Install
You can use this as an API in your code as follows:

    $ pip3 install algorithms3

An example of running an algorithm:

```python3
#Check if a string containing brackets is valid or not

from algorithms.stack import validate_parantheses

if __name__ == '__main__':
    test = validate_parantheses('()[]')
    print(test)
```

If an algorithm is listed in this repository but is not in the pip package, it means that I have not uploaded the latest version. I will be doing that once a week. 

## Uninstall
If you want to uninstall, simply run:

    $pip3 uninstall algorithms3

## Tests
I have written basic tests for most of the modules. To run all the tests at once run the following from the base directory of the project:

    $python3 -m unittest discover tests

## Progress
**Data Structures** : 13  
**Algorithms** &nbsp; &nbsp; &nbsp; &nbsp; : 482

## List of Implementations



* [**Arrays**](/algorithms/arrays)  
    - [*Dynamic Array Implementation*](/algorithms/arrays/dynamic_array_implementation.py)  
    - [Add To Array Form](/algorithms/arrays/add_to_array_form.py)  
    - [Array Partition](/algorithms/arrays/array_partition.py)  
    - [Assign Cookies](/algorithms/arrays/assign_cookies.py)  
    - [Best Time To Buy Stock Ii](/algorithms/arrays/best_time_to_buy_stock_II.py)  
    - [Best Time To Buy Stock](/algorithms/arrays/best_time_to_buy_stock.py)  
    - [Contains Duplicate One](/algorithms/arrays/contains_duplicate_one.py)  
    - [Contains Duplicate Range](/algorithms/arrays/contains_duplicate_range.py)  
    - [Degree Array](/algorithms/arrays/degree_array.py)  
    - [Distribute Candies](/algorithms/arrays/distribute_candies.py)  
    - [Find All Dissapeared Numbers](/algorithms/arrays/find_all_dissapeared_numbers.py)  
    - [Find All Duplicates](/algorithms/arrays/find_all_duplicates.py)  
    - [Find Pivot Index](/algorithms/arrays/find_pivot_index.py)  
    - [First Missing Positive](/algorithms/arrays/first_missing_positive.py)  
    - [Friends Of Ages](/algorithms/arrays/friends_of_ages.py)  
    - [Increasing Triplets](/algorithms/arrays/increasing_triplets.py)  
    - [Intersection Two Arrays Ii](/algorithms/arrays/intersection_two_arrays_II.py)  
    - [Is Monotonic](/algorithms/arrays/is_monotonic.py)  
    - [K Diff Pairs](/algorithms/arrays/k_diff_pairs.py)  
    - [Largest Number Twice Of Others](/algorithms/arrays/largest_number_twice_of_others.py)  
    - [Longest Continuous Increasing Subsequence](/algorithms/arrays/longest_continuous_increasing_subsequence.py)  
    - [Max Average Subarray](/algorithms/arrays/max_average_subarray.py)  
    - [Max Consecutive Ones](/algorithms/arrays/max_consecutive_ones.py)  
    - [Max Product Three Numbers](/algorithms/arrays/max_product_three_numbers.py)  
    - [Maximize Distance To Nearest Person](/algorithms/arrays/maximize_distance_to_nearest_person.py)  
    - [Maximum Subarray](/algorithms/arrays/maximum_subarray.py)  
    - [Merge Intervals](/algorithms/arrays/merge_intervals.py)  
    - [Merge Sorted Array](/algorithms/arrays/merge_sorted_array.py)  
    - [Minimum Moves To Equal Array](/algorithms/arrays/minimum_moves_to_equal_array.py)  
    - [Move Zeroes](/algorithms/arrays/move_zeroes.py)  
    - [Next Greater Element](/algorithms/arrays/next_greater_element.py)  
    - [Non Decreasing Array](/algorithms/arrays/non_decreasing_array.py)  
    - [Number Plus One](/algorithms/arrays/number_plus_one.py)  
    - [Partition Array In Three](/algorithms/arrays/partition_array_in_three.py)  
    - [Place Flowers](/algorithms/arrays/place_flowers.py)  
    - [Positions Large Groups](/algorithms/arrays/positions_large_groups.py)  
    - [Product Of Array Except Self](/algorithms/arrays/product_of_array_except_self.py)  
    - [Remove Duplicates Two](/algorithms/arrays/remove_duplicates_two.py)  
    - [Rotate Array](/algorithms/arrays/rotate_array.py)  
    - [Set Mismatch](/algorithms/arrays/set_mismatch.py)  
    - [Shortest Unsorted Subarray](/algorithms/arrays/shortest_unsorted_subarray.py)  
    - [Smallest Range I](/algorithms/arrays/smallest_range_I.py)  
    - [Sum After Queries](/algorithms/arrays/sum_after_queries.py)  
    - [Summary Ranges](/algorithms/arrays/summary_ranges.py)  
    - [Third Max Number](/algorithms/arrays/third_max_number.py)  
    - [Two Sum Sorted Array](/algorithms/arrays/two_sum_sorted_array.py)  

* [**Backtracking**](/algorithms/backtracking)  
    - [Binary Watch](/algorithms/backtracking/binary_watch.py)  
    - [Combinations Sum Three](/algorithms/backtracking/combinations_sum_three.py)  
    - [Combinations Sum Two](/algorithms/backtracking/combinations_sum_two.py)  
    - [Combinations Sum](/algorithms/backtracking/combinations_sum.py)  
    - [Combinations](/algorithms/backtracking/combinations.py)  
    - [Generate Paranthesis](/algorithms/backtracking/generate_paranthesis.py)  
    - [Letter Case Permutations](/algorithms/backtracking/letter_case_permutations.py)  
    - [Letter Combinations](/algorithms/backtracking/letter_combinations.py)  
    - [Matchsticks To Square](/algorithms/backtracking/matchsticks_to_square.py)  
    - [N Queens Ii](/algorithms/backtracking/n_queens_II.py)  
    - [N Queens](/algorithms/backtracking/n_queens.py)  
    - [Permutation Sequence](/algorithms/backtracking/permutation_sequence.py)  
    - [Permutations One](/algorithms/backtracking/permutations_one.py)  
    - [Permutations Two](/algorithms/backtracking/permutations_two.py)  
    - [Subsets Duplicates](/algorithms/backtracking/subsets_duplicates.py)  
    - [Subsets](/algorithms/backtracking/subsets.py)  
    - [Valid Time](/algorithms/backtracking/valid_time.py)  

* [**Bash**](/algorithms/bash)  
    - [Tenth Line](/algorithms/bash/tenth_line.sh)  
    - [Valid Phone Number](/algorithms/bash/valid_phone_number.sh)  

* [**Binarysearch**](/algorithms/binarysearch)  
    - [4Sum Ii](/algorithms/binarysearch/4sum_II.py)  
    - [Arranging Coins](/algorithms/binarysearch/arranging_coins.py)  
    - [Binary Search](/algorithms/binarysearch/binary_search.py)  
    - [Find K Closest](/algorithms/binarysearch/find_k_closest.py)  
    - [Find Peak](/algorithms/binarysearch/find_peak.py)  
    - [Find Right Interval](/algorithms/binarysearch/find_right_interval.py)  
    - [First Bad](/algorithms/binarysearch/first_bad.py)  
    - [Guess Number](/algorithms/binarysearch/guess_number.py)  
    - [H Index](/algorithms/binarysearch/h_index.py)  
    - [Heaters](/algorithms/binarysearch/heaters.py)  
    - [Min In Rotated Sorted Array](/algorithms/binarysearch/min_in_rotated_sorted_array.py)  
    - [Minimum Size Subarray](/algorithms/binarysearch/minimum_size_subarray.py)  
    - [Next Greater Letter](/algorithms/binarysearch/next_greater_letter.py)  
    - [Peak Index Mountain Array](/algorithms/binarysearch/peak_index_mountain_array.py)  
    - [Search 2D Matrix Ii](/algorithms/binarysearch/search_2d_matrix_II.py)  
    - [Search 2D Matrix](/algorithms/binarysearch/search_2d_matrix.py)  
    - [Search Insert Position](/algorithms/binarysearch/search_insert_position.py)  
    - [Search Range](/algorithms/binarysearch/search_range.py)  
    - [Search Rotated Array Ii](/algorithms/binarysearch/search_rotated_array_II.py)  
    - [Search Rotated Array](/algorithms/binarysearch/search_rotated_array.py)  
    - [Sqrt Number](/algorithms/binarysearch/sqrt_number.py)  
    - [Valid Perfect Square](/algorithms/binarysearch/valid_perfect_square.py)  

* [**Bits**](/algorithms/bits)  
    - [Binary Gap](/algorithms/bits/binary_gap.py)  
    - [Complement Base 10 Integer](/algorithms/bits/complement_base_10_integer.py)  
    - [Count 1 Bits](/algorithms/bits/count_1_bits.py)  
    - [Count Set Bits Prime](/algorithms/bits/count_set_bits_prime.py)  
    - [Is One Bit Character](/algorithms/bits/is_one_bit_character.py)  
    - [Number With Alternating Bits](/algorithms/bits/number_with_alternating_bits.py)  
    - [Prefix Divisible 5](/algorithms/bits/prefix_divisible_5.py)  
    - [Reverse Bits](/algorithms/bits/reverse_bits.py)  
    - [Single Number](/algorithms/bits/single_number.py)  
    - [Sum Two Numbers](/algorithms/bits/sum_two_numbers.py)  

* [**Binary Search Tree**](/algorithms/bst)  
    - [*Bst Implementation*](/algorithms/bst/bst_implementation.py)  
    - [Bst Iterator](/algorithms/bst/bst_iterator.py)  
    - [Bst To Greater Sum Tree](/algorithms/bst/bst_to_greater_sum_tree.py)  
    - [Delete Node](/algorithms/bst/delete_node.py)  
    - [Find Mode Bst](/algorithms/bst/find_mode_bst.py)  
    - [Increasing Order Search Tree](/algorithms/bst/increasing_order_search_tree.py)  
    - [Kth Smallest Element](/algorithms/bst/kth_smallest_element.py)  
    - [List To Bst](/algorithms/bst/list_to_bst.py)  
    - [Lowest Common Ancestor Bst](/algorithms/bst/lowest_common_ancestor_bst.py)  
    - [Min Distance Bst](/algorithms/bst/min_distance_bst.py)  
    - [Minimum Diff Bst](/algorithms/bst/minimum_diff_bst.py)  
    - [Range Sum Bst](/algorithms/bst/range_sum_bst.py)  
    - [Recover Bst](/algorithms/bst/recover_bst.py)  
    - [Search Bst](/algorithms/bst/search_bst.py)  
    - [Two Sum Bst](/algorithms/bst/two_sum_bst.py)  
    - [Validate Bst](/algorithms/bst/validate_bst.py)  

* [**Dynamic Programming**](/algorithms/dp)  
    - [Best Sight Seeing Pair](/algorithms/dp/best_sight_seeing_pair.py)  
    - [Capacity To Ship Packages](/algorithms/dp/capacity_to_ship_packages.py)  
    - [Climbing Stairs](/algorithms/dp/climbing_stairs.py)  
    - [Continuous Subarray Sum](/algorithms/dp/continuous_subarray_sum.py)  
    - [Delete Operations For Two Strings](/algorithms/dp/delete_operations_for_two_strings.py)  
    - [Edit Distance](/algorithms/dp/edit_distance.py)  
    - [Fibonacci](/algorithms/dp/fibonacci.py)  
    - [House Robber](/algorithms/dp/house_robber.py)  
    - [Integer Replacement](/algorithms/dp/integer_replacement.py)  
    - [Jump Game](/algorithms/dp/jump_game.py)  
    - [Kth Grammar](/algorithms/dp/kth_grammar.py)  
    - [Longest Common Subsequence](/algorithms/dp/longest_common_subsequence.py)  
    - [Longest Increasing Subsequence](/algorithms/dp/longest_increasing_subsequence.py)  
    - [Max Crossed Lines](/algorithms/dp/max_crossed_lines.py)  
    - [Max Product Subarray](/algorithms/dp/max_product_subarray.py)  
    - [Maximum Sum Two Non Overlapping Subarray](/algorithms/dp/maximum_sum_two_non_overlapping_subarray.py)  
    - [Min Cost Climbing Stairs](/algorithms/dp/min_cost_climbing_stairs.py)  
    - [Minimum Path Sum](/algorithms/dp/minimum_path_sum.py)  
    - [Nth Ugly Number](/algorithms/dp/nth_ugly_number.py)  
    - [Partition Equal Subset](/algorithms/dp/partition_equal_subset.py)  
    - [Pascal Row](/algorithms/dp/pascal_row.py)  
    - [Pascal](/algorithms/dp/pascal.py)  
    - [Pow](/algorithms/dp/pow.py)  
    - [Range Sum Query 2D](/algorithms/dp/range_sum_query_2d.py)  
    - [Range Sum Query Mutable](/algorithms/dp/range_sum_query_mutable.py)  
    - [Range Sum Query](/algorithms/dp/range_sum_query.py)  
    - [Super Ugly Number](/algorithms/dp/super_ugly_number.py)  
    - [Triangle Min Path](/algorithms/dp/triangle_min_path.py)  
    - [Unique Paths With Obstacle](/algorithms/dp/unique_paths_with_obstacle.py)  
    - [Unique Paths](/algorithms/dp/unique_paths.py)  
    - [Zero One Matrix](/algorithms/dp/zero_one_matrix.py)  

* [**Graphs**](/algorithms/graphs)  
    - [*Graph Implementation*](/algorithms/graphs/graph_implementation.py)  
    - [Bt Right View](/algorithms/graphs/bt_right_view.py)  
    - [Clone Graph](/algorithms/graphs/clone_graph.py)  
    - [Color The Border](/algorithms/graphs/color_the_border.py)  
    - [Concatenated Words](/algorithms/graphs/concatenated_words.py)  
    - [Course Order](/algorithms/graphs/course_order.py)  
    - [Employee Importance](/algorithms/graphs/employee_importance.py)  
    - [Flood Fill](/algorithms/graphs/flood_fill.py)  
    - [Flower Planting With No Adjacent](/algorithms/graphs/flower_planting_with_no_adjacent.py)  
    - [Friend Circle](/algorithms/graphs/friend_circle.py)  
    - [House Robber Three](/algorithms/graphs/house_robber_three.py)  
    - [Is Bipartate](/algorithms/graphs/is_bipartate.py)  
    - [Jump Game Ii](/algorithms/graphs/jump_game_II.py)  
    - [Keys And Rooms](/algorithms/graphs/keys_and_rooms.py)  
    - [Longest Increasing Path Matrix](/algorithms/graphs/longest_increasing_path_matrix.py)  
    - [Make Larger Island](/algorithms/graphs/make_larger_island.py)  
    - [Max Area Island](/algorithms/graphs/max_area_island.py)  
    - [Minesweeper](/algorithms/graphs/minesweeper.py)  
    - [Minimum Height Trees](/algorithms/graphs/minimum_height_trees.py)  
    - [Network Delay Time](/algorithms/graphs/network_delay_time.py)  
    - [Number Islands](/algorithms/graphs/number_islands.py)  
    - [Number Of Enclaves](/algorithms/graphs/number_of_enclaves.py)  
    - [Pacific Atlantic Water Flow](/algorithms/graphs/pacific_atlantic_water_flow.py)  
    - [Perfect Squares](/algorithms/graphs/perfect_squares.py)  
    - [Redundant Connection](/algorithms/graphs/redundant_connection.py)  
    - [Rotton Oranges](/algorithms/graphs/rotton_oranges.py)  
    - [Shortest Bridge](/algorithms/graphs/shortest_bridge.py)  
    - [Surround Region](/algorithms/graphs/surround_region.py)  
    - [Town Judge](/algorithms/graphs/town_judge.py)  
    - [Word Ladder Two](/algorithms/graphs/word_ladder_two.py)  
    - [Word Ladder](/algorithms/graphs/word_ladder.py)  
    - [Word Search](/algorithms/graphs/word_search.py)  

* [**Greedy**](/algorithms/greedy)  
    - [Burst Balloons](/algorithms/greedy/burst_balloons.py)  
    - [Di String Match](/algorithms/greedy/di_string_match.py)  
    - [Dota2 Senate](/algorithms/greedy/dota2_senate.py)  
    - [Fair Candy Swap](/algorithms/greedy/fair_candy_swap.py)  
    - [Is Subsequence](/algorithms/greedy/is_subsequence.py)  
    - [Make Paran Valid](/algorithms/greedy/make_paran_valid.py)  
    - [Max Chunks To Make Sorted Ii](/algorithms/greedy/max_chunks_to_make_sorted_II.py)  
    - [Max Chunks To Make Sorted](/algorithms/greedy/max_chunks_to_make_sorted.py)  
    - [Maximize Sum Array](/algorithms/greedy/maximize_sum_array.py)  
    - [Moving Stones](/algorithms/greedy/moving_stones.py)  
    - [Non Overlapping Intervals](/algorithms/greedy/non_overlapping_intervals.py)  
    - [Queue Reconstruction By Height](/algorithms/greedy/queue_reconstruction_by_height.py)  
    - [Relative Ranks](/algorithms/greedy/relative_ranks.py)  
    - [Remove Outermost Parantheses](/algorithms/greedy/remove_outermost_parantheses.py)  
    - [Reorganize String](/algorithms/greedy/reorganize_string.py)  
    - [Two City Scheduling](/algorithms/greedy/two_city_scheduling.py)  

* [**Hash Tables**](/algorithms/hashtables)  
    - [*Hashmap Implementation*](/algorithms/hashtables/hashmap_implementation.py)  
    - [Banned Words](/algorithms/hashtables/banned_words.py)  
    - [Boomerang Points](/algorithms/hashtables/boomerang_points.py)  
    - [Bulls And Cows](/algorithms/hashtables/bulls_and_cows.py)  
    - [Deck Of Cards](/algorithms/hashtables/deck_of_cards.py)  
    - [Distant Barcodes](/algorithms/hashtables/distant_barcodes.py)  
    - [Encode Decode](/algorithms/hashtables/encode_decode.py)  
    - [Expressive Words](/algorithms/hashtables/expressive_words.py)  
    - [Find And Replace Pattern](/algorithms/hashtables/find_and_replace_pattern.py)  
    - [Find Common Characters](/algorithms/hashtables/find_common_characters.py)  
    - [Four Sum](/algorithms/hashtables/four_sum.py)  
    - [Fraction To Decimal](/algorithms/hashtables/fraction_to_decimal.py)  
    - [Group Anagrams](/algorithms/hashtables/group_anagrams.py)  
    - [Hashmap](/algorithms/hashtables/hashmap.py)  
    - [Hashset](/algorithms/hashtables/hashset.py)  
    - [Insert Delete Random Duplicates](/algorithms/hashtables/insert_delete_random_duplicates.py)  
    - [Insert Delete Random](/algorithms/hashtables/insert_delete_random.py)  
    - [Keyboard Row](/algorithms/hashtables/keyboard_row.py)  
    - [Largest Triangle Area](/algorithms/hashtables/largest_triangle_area.py)  
    - [Lemonade Change](/algorithms/hashtables/lemonade_change.py)  
    - [Longest Word Dictionary](/algorithms/hashtables/longest_word_dictionary.py)  
    - [Lru Cache](/algorithms/hashtables/lru_cache.py)  
    - [Magic Dictionary](/algorithms/hashtables/magic_dictionary.py)  
    - [Minimum Index Sum Of Two Lists](/algorithms/hashtables/minimum_index_sum_of_two_lists.py)  
    - [N Repeated Elements](/algorithms/hashtables/n_repeated_elements.py)  
    - [Pairs With Sum](/algorithms/hashtables/pairs_with_sum.py)  
    - [Powerful Integers](/algorithms/hashtables/powerful_integers.py)  
    - [Repeated Dna Sequences](/algorithms/hashtables/repeated_dna_sequences.py)  
    - [Shortest Completing Word](/algorithms/hashtables/shortest_completing_word.py)  
    - [Shuffle Array](/algorithms/hashtables/shuffle_array.py)  
    - [Sort By Count](/algorithms/hashtables/sort_by_count.py)  
    - [Subdomain Visit Count](/algorithms/hashtables/subdomain_visit_count.py)  
    - [Substring Concat](/algorithms/hashtables/substring_concat.py)  
    - [Three Sum](/algorithms/hashtables/three_sum.py)  
    - [Two Sum](/algorithms/hashtables/two_sum.py)  
    - [Uncommon Words](/algorithms/hashtables/uncommon_words.py)  
    - [Valid Sudoku](/algorithms/hashtables/valid_sudoku.py)  
    - [Verifying Alien Dictionary](/algorithms/hashtables/verifying_alien_dictionary.py)  
    - [Word Pattern](/algorithms/hashtables/word_pattern.py)  
    - [Word Subsets](/algorithms/hashtables/word_subsets.py)  

* [**Heaps**](/algorithms/heaps)  
    - [*Heap Implementation*](/algorithms/heaps/heap_implementation.py)  
    - [*Priority Queue Implementation*](/algorithms/heaps/priority_queue_implementation.py)  
    - [Check Valid Triangle](/algorithms/heaps/check_valid_triangle.py)  
    - [Design Twitter](/algorithms/heaps/design_twitter.py)  
    - [K Most Frequent](/algorithms/heaps/k_most_frequent.py)  
    - [K Pairs With Smallest Sums](/algorithms/heaps/k_pairs_with_smallest_sums.py)  
    - [Kth Largest In Stream](/algorithms/heaps/kth_largest_in_stream.py)  
    - [Kth Largest](/algorithms/heaps/kth_largest.py)  
    - [Kth Smallest In Sorted Matrix](/algorithms/heaps/kth_smallest_in_sorted_matrix.py)  
    - [Last Stone Weight](/algorithms/heaps/last_stone_weight.py)  
    - [Median Of Stream](/algorithms/heaps/median_of_stream.py)  
    - [Top K Frequent Words](/algorithms/heaps/top_k_frequent_words.py)  

* [**Linked List**](/algorithms/linkedlist)  
    - [*Singly Linked List Implementation*](/algorithms/linkedlist/singly_linked_list_implementation.py)  
    - [Add Two Numbers Ii](/algorithms/linkedlist/add_two_numbers_II.py)  
    - [Add Two Numbers](/algorithms/linkedlist/add_two_numbers.py)  
    - [Delete Duplicates All](/algorithms/linkedlist/delete_duplicates_all.py)  
    - [Delete Duplicates](/algorithms/linkedlist/delete_duplicates.py)  
    - [Delete Node Without Head](/algorithms/linkedlist/delete_node_without_head.py)  
    - [Intersection](/algorithms/linkedlist/intersection.py)  
    - [Linked Cycle](/algorithms/linkedlist/linked_cycle.py)  
    - [Linked List Cycle Ii](/algorithms/linkedlist/linked_list_cycle_II.py)  
    - [Linkedlist](/algorithms/linkedlist/linkedlist.py)  
    - [List Palindrome](/algorithms/linkedlist/list_palindrome.py)  
    - [Merge K Lists](/algorithms/linkedlist/merge_k_lists.py)  
    - [Merge Two Lists](/algorithms/linkedlist/merge_two_lists.py)  
    - [Middle Linked List](/algorithms/linkedlist/middle_linked_list.py)  
    - [Next Greater Node](/algorithms/linkedlist/next_greater_node.py)  
    - [Odd Even Linked List](/algorithms/linkedlist/odd_even_linked_list.py)  
    - [Partition List](/algorithms/linkedlist/partition_list.py)  
    - [Remove Element](/algorithms/linkedlist/remove_element.py)  
    - [Remove Nth End](/algorithms/linkedlist/remove_nth_end.py)  
    - [Reorder List](/algorithms/linkedlist/reorder_list.py)  
    - [Reverse K Groups](/algorithms/linkedlist/reverse_k_groups.py)  
    - [Reverse Linkedlist](/algorithms/linkedlist/reverse_linkedlist.py)  
    - [Reverse Mn](/algorithms/linkedlist/reverse_mn.py)  
    - [Rotate List](/algorithms/linkedlist/rotate_list.py)  
    - [Sort List](/algorithms/linkedlist/sort_list.py)  
    - [Split List In Parts](/algorithms/linkedlist/split_list_in_parts.py)  
    - [Swap Pairs](/algorithms/linkedlist/swap_pairs.py)  

* [**Math**](/algorithms/math)  
    - [Add Binary](/algorithms/math/add_binary.py)  
    - [Add Digits](/algorithms/math/add_digits.py)  
    - [Basic Calculator I](/algorithms/math/basic_calculator_I.py)  
    - [Basic Calculator Ii](/algorithms/math/basic_calculator_II.py)  
    - [Construct Rectangle](/algorithms/math/construct_rectangle.py)  
    - [Convert To Base 7](/algorithms/math/convert_to_base_7.py)  
    - [Convert To Hex](/algorithms/math/convert_to_hex.py)  
    - [Convert To Number](/algorithms/math/convert_to_number.py)  
    - [Count Primes](/algorithms/math/count_primes.py)  
    - [Count Zeroes Factorial](/algorithms/math/count_zeroes_factorial.py)  
    - [Divide Two Numbers](/algorithms/math/divide_two_numbers.py)  
    - [Game Of Nim](/algorithms/math/game_of_nim.py)  
    - [Hamming Distance](/algorithms/math/hamming_distance.py)  
    - [Happy Numbers](/algorithms/math/happy_numbers.py)  
    - [Integer To English Words](/algorithms/math/integer_to_english_words.py)  
    - [Intersection Two Arrays](/algorithms/math/intersection_two_arrays.py)  
    - [Largest Triangle Area](/algorithms/math/largest_triangle_area.py)  
    - [Majority Element](/algorithms/math/majority_element.py)  
    - [Min Time Difference](/algorithms/math/min_time_difference.py)  
    - [Minimum Area Rectangle](/algorithms/math/minimum_area_rectangle.py)  
    - [Missing Number](/algorithms/math/missing_number.py)  
    - [Next Greater Iii](/algorithms/math/next_greater_III.py)  
    - [Next Permutation](/algorithms/math/next_permutation.py)  
    - [Nth Digit](/algorithms/math/nth_digit.py)  
    - [Num To Col](/algorithms/math/num_to_col.py)  
    - [Perfect Number](/algorithms/math/perfect_number.py)  
    - [Power Of Two](/algorithms/math/power_of_two.py)  
    - [Reach A Number](/algorithms/math/reach_a_number.py)  
    - [Rectangle Overlap](/algorithms/math/rectangle_overlap.py)  
    - [Self Dividing Numbers](/algorithms/math/self_dividing_numbers.py)  
    - [Smallest Integer Divisible By K](/algorithms/math/smallest_integer_divisible_by_k.py)  
    - [Total Time](/algorithms/math/total_time.py)  
    - [Ugly Numbers](/algorithms/math/ugly_numbers.py)  
    - [Valid Boomerang](/algorithms/math/valid_boomerang.py)  
    - [Valid Number](/algorithms/math/valid_number.py)  

* [**Matrix**](/algorithms/matrix)  
    - [Brick Wall](/algorithms/matrix/brick_wall.py)  
    - [Flip Image](/algorithms/matrix/flip_image.py)  
    - [Game Of Life](/algorithms/matrix/game_of_life.py)  
    - [Image Smoother](/algorithms/matrix/image_smoother.py)  
    - [Island Perimeter](/algorithms/matrix/island_perimeter.py)  
    - [Magic Squares In Grid](/algorithms/matrix/magic_squares_in_grid.py)  
    - [Matrix Cells Distance](/algorithms/matrix/matrix_cells_distance.py)  
    - [Range Addition](/algorithms/matrix/range_addition.py)  
    - [Reshape Matrix](/algorithms/matrix/reshape_matrix.py)  
    - [Robot Bounded Circle](/algorithms/matrix/robot_bounded_circle.py)  
    - [Rook Captures](/algorithms/matrix/rook_captures.py)  
    - [Rotate Image](/algorithms/matrix/rotate_image.py)  
    - [Set Matrix Zeros](/algorithms/matrix/set_matrix_zeros.py)  
    - [Spiral Matrix Generate](/algorithms/matrix/spiral_matrix_generate.py)  
    - [Spiral Matrix Iii](/algorithms/matrix/spiral_matrix_III.py)  
    - [Spiral Matrix](/algorithms/matrix/spiral_matrix.py)  
    - [Toeplitz Matrix](/algorithms/matrix/toeplitz_matrix.py)  
    - [Transpose Matrix](/algorithms/matrix/transpose_matrix.py)  
    - [Walking Robot Simulation](/algorithms/matrix/walking_robot_simulation.py)  

* [**Mysql**](/algorithms/mysql)  
    - [Big Countries.](/algorithms/mysql/big_countries.sql)  
    - [Classes More Than 5.](/algorithms/mysql/classes_more_than_5.sql)  
    - [Combine Two Tables.](/algorithms/mysql/combine_two_tables.sql)  
    - [Customers Who Never Order.](/algorithms/mysql/customers_who_never_order.sql)  
    - [Delete Duplicate Emails.](/algorithms/mysql/delete_duplicate_emails.sql)  
    - [Duplicate Emails.](/algorithms/mysql/duplicate_emails.sql)  
    - [Employee Earning More Than Managers.](/algorithms/mysql/employee_earning_more_than_managers.sql)  
    - [Not Boring Movies.](/algorithms/mysql/not_boring_movies.sql)  
    - [Rising Temperature.](/algorithms/mysql/rising_temperature.sql)  
    - [Second Highest Salary.](/algorithms/mysql/second_highest_salary.sql)  
    - [Swap Salary.](/algorithms/mysql/swap_salary.sql)  

* [**Queues**](/algorithms/queues)  
    - [*Circular Deque Implementation*](/algorithms/queues/circular_deque_implementation.py)  
    - [*Circular Queue Implementation*](/algorithms/queues/circular_queue_implementation.py)  
    - [*Queue Implementation*](/algorithms/queues/queue_implementation.py)  
    - [Gas Station](/algorithms/queues/gas_station.py)  
    - [Max Sliding Window](/algorithms/queues/max_sliding_window.py)  
    - [Queue Using Stacks](/algorithms/queues/queue_using_stacks.py)  
    - [Rotate String](/algorithms/queues/rotate_string.py)  
    - [Stack Using Queues](/algorithms/queues/stack_using_queues.py)  

* [**Sort**](/algorithms/sort)  
    - [Bubble Sort](/algorithms/sort/bubble_sort.py)  
    - [Delete Columns To Make Sorted](/algorithms/sort/delete_columns_to_make_sorted.py)  
    - [Height Checker](/algorithms/sort/height_checker.py)  
    - [Insertion Sort](/algorithms/sort/insertion_sort.py)  
    - [Longest Harmonious Sequence](/algorithms/sort/longest_harmonious_sequence.py)  
    - [Max Gap](/algorithms/sort/max_gap.py)  
    - [Merge Sort](/algorithms/sort/merge_sort.py)  
    - [Most Profit Workers](/algorithms/sort/most_profit_workers.py)  
    - [Quick Sort](/algorithms/sort/quick_sort.py)  
    - [Reorder Logs](/algorithms/sort/reorder_logs.py)  
    - [Selection Sort](/algorithms/sort/selection_sort.py)  
    - [Sort Array Parity Ii](/algorithms/sort/sort_array_parity_II.py)  
    - [Sort By Parity](/algorithms/sort/sort_by_parity.py)  
    - [Sort Three Colors](/algorithms/sort/sort_three_colors.py)  

* [**Stack**](/algorithms/stack)  
    - [Baseball Game](/algorithms/stack/baseball_game.py)  
    - [Duplicate Removal](/algorithms/stack/duplicate_removal.py)  
    - [Evaluate Reverse Polish Notation](/algorithms/stack/evaluate_reverse_polish_notation.py)  
    - [Exclusive Fuction Time](/algorithms/stack/exclusive_fuction_time.py)  
    - [Min Stack](/algorithms/stack/min_stack.py)  
    - [Next Greater Element Ii](/algorithms/stack/next_greater_element_II.py)  
    - [One Three Two Pattern](/algorithms/stack/one_three_two_pattern.py)  
    - [Remove K Digits](/algorithms/stack/remove_k_digits.py)  
    - [Simplify Path](/algorithms/stack/simplify_path.py)  
    - [Valid Paran](/algorithms/stack/valid_paran.py)  
    - [Validate Stack Sequence](/algorithms/stack/validate_stack_sequence.py)  

* [**Strings**](/algorithms/strings)  
    - [Add Binary](/algorithms/strings/add_binary.py)  
    - [Add Strings](/algorithms/strings/add_strings.py)  
    - [Backspace Compare](/algorithms/strings/backspace_compare.py)  
    - [Buddy Strings](/algorithms/strings/buddy_strings.py)  
    - [Camelcase Matching](/algorithms/strings/camelcase_matching.py)  
    - [Compare Version Numbers](/algorithms/strings/compare_version_numbers.py)  
    - [Complex Number Multiplication](/algorithms/strings/complex_number_multiplication.py)  
    - [Count Binary Strings](/algorithms/strings/count_binary_strings.py)  
    - [Count Say](/algorithms/strings/count_say.py)  
    - [Decode String](/algorithms/strings/decode_string.py)  
    - [Detect Capital](/algorithms/strings/detect_capital.py)  
    - [Find All Anagrams](/algorithms/strings/find_all_anagrams.py)  
    - [Find And Replace](/algorithms/strings/find_and_replace.py)  
    - [Find Duplicate Files](/algorithms/strings/find_duplicate_files.py)  
    - [First Unique Character](/algorithms/strings/first_unique_character.py)  
    - [Goat Latin](/algorithms/strings/goat_latin.py)  
    - [Int To Roman](/algorithms/strings/int_to_roman.py)  
    - [Isomorphic](/algorithms/strings/isomorphic.py)  
    - [Jewels](/algorithms/strings/jewels.py)  
    - [Largest Number](/algorithms/strings/largest_number.py)  
    - [Length Of Last Word](/algorithms/strings/length_of_last_word.py)  
    - [Licence Key Reformatting](/algorithms/strings/licence_key_reformatting.py)  
    - [Long Pressed Name](/algorithms/strings/long_pressed_name.py)  
    - [Longest Common Prefix](/algorithms/strings/longest_common_prefix.py)  
    - [Longest Palin Substring](/algorithms/strings/longest_palin_substring.py)  
    - [Longest Palindrome](/algorithms/strings/longest_palindrome.py)  
    - [Longest Substring With K Chars](/algorithms/strings/longest_substring_with_k_chars.py)  
    - [Longest Substring Without Repeating](/algorithms/strings/longest_substring_without_repeating.py)  
    - [Longest Uncommon Seq](/algorithms/strings/longest_uncommon_seq.py)  
    - [Minimum Window String](/algorithms/strings/minimum_window_string.py)  
    - [Multiply Strings](/algorithms/strings/multiply_strings.py)  
    - [Number Of Segments String](/algorithms/strings/number_of_segments_string.py)  
    - [Optimal Division](/algorithms/strings/optimal_division.py)  
    - [Palindrome](/algorithms/strings/palindrome.py)  
    - [Permutations In String](/algorithms/strings/permutations_in_string.py)  
    - [Ransom Note](/algorithms/strings/ransom_note.py)  
    - [Remove Comments](/algorithms/strings/remove_comments.py)  
    - [Repeated String Match](/algorithms/strings/repeated_string_match.py)  
    - [Repeated Substring Pattern](/algorithms/strings/repeated_substring_pattern.py)  
    - [Reverse Int](/algorithms/strings/reverse_int.py)  
    - [Reverse Only Letters](/algorithms/strings/reverse_only_letters.py)  
    - [Reverse String Ii](/algorithms/strings/reverse_string_II.py)  
    - [Reverse String Words](/algorithms/strings/reverse_string_words.py)  
    - [Reverse String](/algorithms/strings/reverse_string.py)  
    - [Reverse Vowels Strings](/algorithms/strings/reverse_vowels_strings.py)  
    - [Reverse Words Iii](/algorithms/strings/reverse_words_III.py)  
    - [Robot Origin](/algorithms/strings/robot_origin.py)  
    - [Roman To Int](/algorithms/strings/roman_to_int.py)  
    - [Rotated Digits](/algorithms/strings/rotated_digits.py)  
    - [Shifting Letters](/algorithms/strings/shifting_letters.py)  
    - [Shortest Distance To Character](/algorithms/strings/shortest_distance_to_character.py)  
    - [String Compression](/algorithms/strings/string_compression.py)  
    - [String To Integer](/algorithms/strings/string_to_integer.py)  
    - [Strstr](/algorithms/strings/strstr.py)  
    - [To Lower](/algorithms/strings/to_lower.py)  
    - [Unique Email](/algorithms/strings/unique_email.py)  
    - [Unique Morse Code](/algorithms/strings/unique_morse_code.py)  
    - [Valid Anagram](/algorithms/strings/valid_anagram.py)  
    - [Valid Ip](/algorithms/strings/valid_ip.py)  
    - [Valid Palin](/algorithms/strings/valid_palin.py)  
    - [Valid Palindrome Ii](/algorithms/strings/valid_palindrome_II.py)  
    - [Valid String After Subs](/algorithms/strings/valid_string_after_subs.py)  
    - [Zigzag Conversion](/algorithms/strings/zigzag_conversion.py)  

* [**Trees**](/algorithms/trees)  
    - [*Tree Implementation*](/algorithms/trees/tree_implementation.py)  
    - [*Trie Implementation*](/algorithms/trees/trie_implementation.py)  
    - [Array Bst](/algorithms/trees/array_bst.py)  
    - [Average Levels](/algorithms/trees/average_levels.py)  
    - [Bst To Greater Tree](/algorithms/trees/bst_to_greater_tree.py)  
    - [Build Tree Postorder](/algorithms/trees/build_tree_postorder.py)  
    - [Construct Pre In](/algorithms/trees/construct_pre_in.py)  
    - [Count Complete Tree Nodes](/algorithms/trees/count_complete_tree_nodes.py)  
    - [Cousins In Binary Trees](/algorithms/trees/cousins_in_binary_trees.py)  
    - [Diameter Binary Tree](/algorithms/trees/diameter_binary_tree.py)  
    - [Find Bottom Left](/algorithms/trees/find_bottom_left.py)  
    - [Flatten Binary Tree To Linked List](/algorithms/trees/flatten_binary_tree_to_linked_list.py)  
    - [Inorder](/algorithms/trees/inorder.py)  
    - [Invert Tree](/algorithms/trees/invert_tree.py)  
    - [Is Balanced](/algorithms/trees/is_balanced.py)  
    - [Largest Value Level](/algorithms/trees/largest_value_level.py)  
    - [Left Similar Trees](/algorithms/trees/left_similar_trees.py)  
    - [Level Order One](/algorithms/trees/level_order_one.py)  
    - [Level Order Two](/algorithms/trees/level_order_two.py)  
    - [Lowest Common Ancestor](/algorithms/trees/lowest_common_ancestor.py)  
    - [Max Depth N Ary](/algorithms/trees/max_depth_n_ary.py)  
    - [Max Depth](/algorithms/trees/max_depth.py)  
    - [Max Subtree](/algorithms/trees/max_subtree.py)  
    - [Maximum Diff Between Ancestor And Node](/algorithms/trees/maximum_diff_between_ancestor_and_node.py)  
    - [Maximum Path Sum](/algorithms/trees/maximum_path_sum.py)  
    - [Merge Two Trees](/algorithms/trees/merge_two_trees.py)  
    - [Min Depth](/algorithms/trees/min_depth.py)  
    - [Most Frequent Subtree Sum](/algorithms/trees/most_frequent_subtree_sum.py)  
    - [N Ary Postorder](/algorithms/trees/n_ary_postorder.py)  
    - [N Ary Preorder](/algorithms/trees/n_ary_preorder.py)  
    - [Nary Level Order](/algorithms/trees/nary_level_order.py)  
    - [Nodes At Distance K](/algorithms/trees/nodes_at_distance_k.py)  
    - [Path Sum All](/algorithms/trees/path_sum_all.py)  
    - [Path Sum Iii](/algorithms/trees/path_sum_III.py)  
    - [Path Sum](/algorithms/trees/path_sum.py)  
    - [Populate Next Right Pointer](/algorithms/trees/populate_next_right_pointer.py)  
    - [Postorder](/algorithms/trees/postorder.py)  
    - [Preorder](/algorithms/trees/preorder.py)  
    - [Same Tree](/algorithms/trees/same_tree.py)  
    - [Second Minimum Node](/algorithms/trees/second_minimum_node.py)  
    - [Serialize Tree](/algorithms/trees/serialize_tree.py)  
    - [Subtree Of Another Tree](/algorithms/trees/subtree_of_another_tree.py)  
    - [Sum Of Left Leaves](/algorithms/trees/sum_of_left_leaves.py)  
    - [Sum Root To Leaf Paths](/algorithms/trees/sum_root_to_leaf_paths.py)  
    - [Sum Root To Leafs](/algorithms/trees/sum_root_to_leafs.py)  
    - [Symmetric](/algorithms/trees/symmetric.py)  
    - [Tilt Tree](/algorithms/trees/tilt_tree.py)  
    - [Tree Paths](/algorithms/trees/tree_paths.py)  
    - [Univalue Tree](/algorithms/trees/univalue_tree.py)  
    - [Verify Tree Serialization](/algorithms/trees/verify_tree_serialization.py)  
    - [Zigzag Level Order](/algorithms/trees/zigzag_level_order.py)  

* [**Trie**](/algorithms/trie)  
    - [*Trie Implementation*](/algorithms/trie/trie_implementation.py)  
    - [Longest Word Dictionary](/algorithms/trie/longest_word_dictionary.py)  
    - [Replace Words](/algorithms/trie/replace_words.py)  
    - [Word Search Ii](/algorithms/trie/word_search_II.py)  

* [**Two Pointers**](/algorithms/twopointers)  
    - [Container With Most Water](/algorithms/twopointers/container_with_most_water.py)  
    - [Find Duplicate Number](/algorithms/twopointers/find_duplicate_number.py)  
    - [Longest Repeating Character Replacement](/algorithms/twopointers/longest_repeating_character_replacement.py)  
    - [Longest Word In Dictionary](/algorithms/twopointers/longest_word_in_dictionary.py)  
    - [Remove Duplicates](/algorithms/twopointers/remove_duplicates.py)  
    - [Remove Element](/algorithms/twopointers/remove_element.py)  
    - [Squares Of Sorted Array](/algorithms/twopointers/squares_of_sorted_array.py)  
    - [Three Sum Closest](/algorithms/twopointers/three_sum_closest.py)