Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
sagasu
python-algorithms
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
python-algorithms
/
leetcode
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
master
Breadcrumbs
python-algorithms
/
leetcode
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
Angle Between Hands of a Clock
Angle Between Hands of a Clock
Delete the Middle Node of a Linked List
Delete the Middle Node of a Linked List
Find the Highest Altitude
Find the Highest Altitude
Maximum Building Height
Maximum Building Height
Maximum Ice Cream Bars
Maximum Ice Cream Bars
Maximum Twin Sum of a Linked List
Maximum Twin Sum of a Linked List
Number of Ways to Assign Edge Weights II
Number of Ways to Assign Edge Weights II
Number of Ways to Assign Edge WeightsI
Number of Ways to Assign Edge WeightsI
Process String with Special Operations I
Process String with Special Operations I
Process String with Special Operations II
Process String with Special Operations II
Shift Distance Between Two Strings
Shift Distance Between Two Strings
Weighted Word Mapping
Weighted Word Mapping
add_binary
add_binary
add_digits
add_digits
add_two_numbers
add_two_numbers
advantage_shuffle
advantage_shuffle
all_elements_in_two_binary_search_trees
all_elements_in_two_binary_search_trees
ambiguous_coordinates
ambiguous_coordinates
apply_operations_on_array_to_maximize_sum_of_squares
apply_operations_on_array_to_maximize_sum_of_squares
arithmetic_slices
arithmetic_slices
arranging_coins
arranging_coins
binary_search_tree
binary_search_tree
binary_tree_cameras
binary_tree_cameras
binary_tree_level_order_traversal
binary_tree_level_order_traversal
binary_tree_right_side_view
binary_tree_right_side_view
binary_trees_with_factors
binary_trees_with_factors
block_placement_queries
block_placement_queries
boats_to_save_people
boats_to_save_people
broken_calculator
broken_calculator
build_an_array_with_stack_operations
build_an_array_with_stack_operations
burst_balloons
burst_balloons
bus_routes
bus_routes
candy
candy
check_if_a_string_contains_all_binary_codes_of_size_k
check_if_a_string_contains_all_binary_codes_of_size_k
check_if_all_1s_are_at_least_length_K_places_away
check_if_all_1s_are_at_least_length_K_places_away
check_if_array_is_good
check_if_array_is_good
check_if_array_is_sorted_and_rotated
check_if_array_is_sorted_and_rotated
check_if_binary_string_has_at_most_one_segment_of_ones
check_if_binary_string_has_at_most_one_segment_of_ones
check_if_strings_can_be_made_equal_with_operations_i
check_if_strings_can_be_made_equal_with_operations_i
check_if_strings_can_be_made_equal_with_operations_ii
check_if_strings_can_be_made_equal_with_operations_ii
check_if_there_is_a_valid_path_in_a_grid
check_if_there_is_a_valid_path_in_a_grid
cherry_pickup_II
cherry_pickup_II
clone_graph
clone_graph
closest_equal_element_queries
closest_equal_element_queries
coin_change
coin_change
combination_sum
combination_sum
compare_version_numbers
compare_version_numbers
complement_of_base_10_Integer
complement_of_base_10_Integer
concatenate_non_zero_digits_and_multiply_by_sum_i
concatenate_non_zero_digits_and_multiply_by_sum_i
concatenate_non_zero_digits_and_multiply_by_sum_ii
concatenate_non_zero_digits_and_multiply_by_sum_ii
constrained_subsequence_sum
constrained_subsequence_sum
construct_binary_tree_from_preorder_and_inorder_traversal
construct_binary_tree_from_preorder_and_inorder_traversal
construct_target_array_with_multiple_sums
construct_target_array_with_multiple_sums
container_with_most_water
container_with_most_water
contiguous_array
contiguous_array
convert_BST_to_treater_tree
convert_BST_to_treater_tree
convert_sorted_list_to_binary_search_tree
convert_sorted_list_to_binary_search_tree
copy_list_with_random_pointer
copy_list_with_random_pointer
count_all_valid_pickup_and_delivery_options
count_all_valid_pickup_and_delivery_options
count_days_spent_together
count_days_spent_together
count_islands_with_total_value_divisible_by_k
count_islands_with_total_value_divisible_by_k
count_nodes_equal_to_average_of_subtree
count_nodes_equal_to_average_of_subtree
count_number_of_homogenous_substrings
count_number_of_homogenous_substrings
count_number_of_special_subsequences
count_number_of_special_subsequences
count_of_smaller_numbers_after_self
count_of_smaller_numbers_after_self
count_submatrices_with_equal_frequency_of_x_and_y
count_submatrices_with_equal_frequency_of_x_and_y
count_submatrices_with_top_left_element_and_sum_less_than_k
count_submatrices_with_top_left_element_and_sum_less_than_k
count_the_number_of_complete_components
count_the_number_of_complete_components
count_the_number_of_special_characters_i
count_the_number_of_special_characters_i
count_the_number_of_special_characters_ii
count_the_number_of_special_characters_ii
count_visited_nodes_in_a_directed_graph
count_visited_nodes_in_a_directed_graph
count_vowels_permutation
count_vowels_permutation
course_Schedule_III
course_Schedule_III
course_schedule_II
course_schedule_II
create_binary_tree_from_descriptions
create_binary_tree_from_descriptions
create_grid_with_exactly_one_path
create_grid_with_exactly_one_path
critical_connections_in_a_network
critical_connections_in_a_network
cyclically_rotating_a_grid
cyclically_rotating_a_grid
decode_string
decode_string
decode_the_slanted_ciphertext
decode_the_slanted_ciphertext
decode_ways_II
decode_ways_II
delete_and_earn
delete_and_earn
delete_operation_for_two_strings
delete_operation_for_two_strings
design_circular_queue
design_circular_queue
design_graph_with_shortest_path_calculator
design_graph_with_shortest_path_calculator
design_underground_system
design_underground_system
destroying_asteroids
destroying_asteroids
detect_cycles_in_2d_grid
detect_cycles_in_2d_grid
determine_if_a_cell_is_reachable_at_a_given_time
determine_if_a_cell_is_reachable_at_a_given_time
determine_if_two_strings_are_close
determine_if_two_strings_are_close
determine_whether_matrix_can_be_obtained_by_rotation
determine_whether_matrix_can_be_obtained_by_rotation
distribute_candies
distribute_candies
earliest_finish_time_for_land_and_water_rides_i
earliest_finish_time_for_land_and_water_rides_i
earliest_finish_time_for_land_and_water_rides_ii
earliest_finish_time_for_land_and_water_rides_ii
edit_distance
edit_distance
eliminate_maximum_number_of_monsters
eliminate_maximum_number_of_monsters
equal_sum_grid_partition_ii
equal_sum_grid_partition_ii
fancy_sequence
fancy_sequence
find-the-maximum-number-of-elements-in-subset
find-the-maximum-number-of-elements-in-subset
find_all_anagrams_in_a_string
find_all_anagrams_in_a_string
View all files
You can’t perform that action at this time.