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
Developer articles
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 }}
github-interview
LeetCode-Book
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
LeetCode-Book
/
java
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
main
Breadcrumbs
LeetCode-Book
/
java
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
include
include
sfo_03_find_duplicate_numbers_in_an_array_s1
sfo_03_find_duplicate_numbers_in_an_array_s1
sfo_03_find_duplicate_numbers_in_an_array_s2
sfo_03_find_duplicate_numbers_in_an_array_s2
sfo_04_find_a_number_in_2d_matrix_s1
sfo_04_find_a_number_in_2d_matrix_s1
sfo_05_replace_spaces_s1
sfo_05_replace_spaces_s1
sfo_06_print_a_linked_list_in_reverse_order_s1
sfo_06_print_a_linked_list_in_reverse_order_s1
sfo_06_print_a_linked_list_in_reverse_order_s2
sfo_06_print_a_linked_list_in_reverse_order_s2
sfo_07_reconstruct_binary_tree_s1
sfo_07_reconstruct_binary_tree_s1
sfo_09_implement_a_queue_using_two_stacks_s1
sfo_09_implement_a_queue_using_two_stacks_s1
sfo_10i_fibonacci_numbers_s1
sfo_10i_fibonacci_numbers_s1
sfo_10ii_frog_jump_s1
sfo_10ii_frog_jump_s1
sfo_11_find_minimum_in_rotated_sorted_array_s1
sfo_11_find_minimum_in_rotated_sorted_array_s1
sfo_11_find_minimum_in_rotated_sorted_array_s2
sfo_11_find_minimum_in_rotated_sorted_array_s2
sfo_12_word_search_s1
sfo_12_word_search_s1
sfo_13_range_of_motion_of_a_robot_s1
sfo_13_range_of_motion_of_a_robot_s1
sfo_13_range_of_motion_of_a_robot_s2
sfo_13_range_of_motion_of_a_robot_s2
sfo_14i_cut_the_rope_i_s1
sfo_14i_cut_the_rope_i_s1
sfo_14ii_cut_the_rope_ii_s1
sfo_14ii_cut_the_rope_ii_s1
sfo_15_number_of_1_bits_s1
sfo_15_number_of_1_bits_s1
sfo_15_number_of_1_bits_s2
sfo_15_number_of_1_bits_s2
sfo_16_powers_of_integers_s1
sfo_16_powers_of_integers_s1
sfo_17_print_from_1_to_the_largest_n_digits_s1
sfo_17_print_from_1_to_the_largest_n_digits_s1
sfo_17_print_from_1_to_the_largest_n_digits_s2
sfo_17_print_from_1_to_the_largest_n_digits_s2
sfo_17_print_from_1_to_the_largest_n_digits_s3
sfo_17_print_from_1_to_the_largest_n_digits_s3
sfo_17_print_from_1_to_the_largest_n_digits_s4
sfo_17_print_from_1_to_the_largest_n_digits_s4
sfo_18_delete_a_node_from_a_linked_list_s1
sfo_18_delete_a_node_from_a_linked_list_s1
sfo_19_regular_expression_matching_s1
sfo_19_regular_expression_matching_s1
sfo_19_regular_expression_matching_s2
sfo_19_regular_expression_matching_s2
sfo_20_a_string_representing_a_numeric_value_s1
sfo_20_a_string_representing_a_numeric_value_s1
sfo_21_adjust_the_order_of_numbers_in_an_array_s1
sfo_21_adjust_the_order_of_numbers_in_an_array_s1
sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1
sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1
sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2
sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2
sfo_24_reverse_a_linked_list_s1
sfo_24_reverse_a_linked_list_s1
sfo_24_reverse_a_linked_list_s2
sfo_24_reverse_a_linked_list_s2
sfo_25_combine_two_sorted_linked_lists_s1
sfo_25_combine_two_sorted_linked_lists_s1
sfo_26_substructure_of_a_binary_tree_s1
sfo_26_substructure_of_a_binary_tree_s1
sfo_27_mirror_of_a_binary_tree_s1
sfo_27_mirror_of_a_binary_tree_s1
sfo_27_mirror_of_a_binary_tree_s2
sfo_27_mirror_of_a_binary_tree_s2
sfo_28_symmetric_binary_tree_s1
sfo_28_symmetric_binary_tree_s1
sfo_29_print_a_given_matrix_in_spiral_form_s1
sfo_29_print_a_given_matrix_in_spiral_form_s1
sfo_30_min_stack_s1
sfo_30_min_stack_s1
sfo_31_validate_stack_sequences_s1
sfo_31_validate_stack_sequences_s1
sfo_32i_print_a_binary_tree_topbottom_i_s1
sfo_32i_print_a_binary_tree_topbottom_i_s1
sfo_32ii_print_a_binary_tree_topbottom_ii_s1
sfo_32ii_print_a_binary_tree_topbottom_ii_s1
sfo_32iii_print_a_binary_tree_topbottom_iii_s1
sfo_32iii_print_a_binary_tree_topbottom_iii_s1
sfo_32iii_print_a_binary_tree_topbottom_iii_s2
sfo_32iii_print_a_binary_tree_topbottom_iii_s2
sfo_32iii_print_a_binary_tree_topbottom_iii_s3
sfo_32iii_print_a_binary_tree_topbottom_iii_s3
sfo_33_postorder_traversal_of_a_binary_search_tree_s1
sfo_33_postorder_traversal_of_a_binary_search_tree_s1
sfo_33_postorder_traversal_of_a_binary_search_tree_s2
sfo_33_postorder_traversal_of_a_binary_search_tree_s2
sfo_34_all_xsum_paths_in_a_binary_tree_s1
sfo_34_all_xsum_paths_in_a_binary_tree_s1
sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1
sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1
sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2
sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2
sfo_36_binary_search_tree_and_doubly_linked_list_s1
sfo_36_binary_search_tree_and_doubly_linked_list_s1
sfo_37_serialize_and_deserialize_a_binary_tree_s1
sfo_37_serialize_and_deserialize_a_binary_tree_s1
sfo_38_all_permutations_of_a_string_s1
sfo_38_all_permutations_of_a_string_s1
sfo_39_the_majority_element_in_an_array_s1
sfo_39_the_majority_element_in_an_array_s1
sfo_39_the_majority_element_in_an_array_s2
sfo_39_the_majority_element_in_an_array_s2
sfo_40_the_smallest_k_numbers_s1
sfo_40_the_smallest_k_numbers_s1
sfo_40_the_smallest_k_numbers_s2
sfo_40_the_smallest_k_numbers_s2
sfo_41_find_median_from_data_stream_s1
sfo_41_find_median_from_data_stream_s1
sfo_42_largest_sum_contiguous_subarray_s1
sfo_42_largest_sum_contiguous_subarray_s1
sfo_43_total_number_of_1_in_integers_from_1_to_n_s1
sfo_43_total_number_of_1_in_integers_from_1_to_n_s1
sfo_44_nth_digit_s1
sfo_44_nth_digit_s1
sfo_45_arrange_an_array_into_the_smallest_number_s1
sfo_45_arrange_an_array_into_the_smallest_number_s1
sfo_45_arrange_an_array_into_the_smallest_number_s2
sfo_45_arrange_an_array_into_the_smallest_number_s2
sfo_46_translate_numbers_into_strings_s1
sfo_46_translate_numbers_into_strings_s1
sfo_46_translate_numbers_into_strings_s2
sfo_46_translate_numbers_into_strings_s2
sfo_46_translate_numbers_into_strings_s3
sfo_46_translate_numbers_into_strings_s3
sfo_47_the_maximum_value_of_gifts_s1
sfo_47_the_maximum_value_of_gifts_s1
sfo_47_the_maximum_value_of_gifts_s2
sfo_47_the_maximum_value_of_gifts_s2
sfo_48_the_longest_substring_without_repeated_characters_s1
sfo_48_the_longest_substring_without_repeated_characters_s1
sfo_48_the_longest_substring_without_repeated_characters_s2
sfo_48_the_longest_substring_without_repeated_characters_s2
sfo_48_the_longest_substring_without_repeated_characters_s3
sfo_48_the_longest_substring_without_repeated_characters_s3
sfo_49_ugly_numbers_s1
sfo_49_ugly_numbers_s1
sfo_50_find_the_first_nonrepeating_character_in_a_string_s1
sfo_50_find_the_first_nonrepeating_character_in_a_string_s1
sfo_50_find_the_first_nonrepeating_character_in_a_string_s2
sfo_50_find_the_first_nonrepeating_character_in_a_string_s2
sfo_51_reversed_pairs_in_an_array_s1
sfo_51_reversed_pairs_in_an_array_s1
sfo_52_the_first_common_node_in_two_linked_lists_s1
sfo_52_the_first_common_node_in_two_linked_lists_s1
sfo_53i_find_a_number_in_a_sorted_array_s1
sfo_53i_find_a_number_in_a_sorted_array_s1
sfo_53i_find_a_number_in_a_sorted_array_s2
sfo_53i_find_a_number_in_a_sorted_array_s2
sfo_53ii_the_missing_number_from_0_to_n1_s1
sfo_53ii_the_missing_number_from_0_to_n1_s1
sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1
sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1
sfo_55i_depth_of_a_binary_tree_s1
sfo_55i_depth_of_a_binary_tree_s1
sfo_55i_depth_of_a_binary_tree_s2
sfo_55i_depth_of_a_binary_tree_s2
sfo_55ii_balanced_binary_tree_s1
sfo_55ii_balanced_binary_tree_s1
sfo_55ii_balanced_binary_tree_s2
sfo_55ii_balanced_binary_tree_s2
sfo_56i_single_number_i_s1
sfo_56i_single_number_i_s1
sfo_56ii_single_number_ii_s1
sfo_56ii_single_number_ii_s1
sfo_56ii_single_number_ii_s2
sfo_56ii_single_number_ii_s2
sfo_57_two_numbers_with_sum_s_s1
sfo_57_two_numbers_with_sum_s_s1
sfo_57ii_consecutive_numbers_with_sum_s_s1
sfo_57ii_consecutive_numbers_with_sum_s_s1
sfo_57ii_consecutive_numbers_with_sum_s_s2
sfo_57ii_consecutive_numbers_with_sum_s_s2
sfo_58i_reverse_order_of_words_s1
sfo_58i_reverse_order_of_words_s1
sfo_58i_reverse_order_of_words_s2
sfo_58i_reverse_order_of_words_s2
sfo_58ii_left_rotation_of_a_string_s1
sfo_58ii_left_rotation_of_a_string_s1
sfo_58ii_left_rotation_of_a_string_s2
sfo_58ii_left_rotation_of_a_string_s2
sfo_58ii_left_rotation_of_a_string_s3
sfo_58ii_left_rotation_of_a_string_s3
sfo_58ii_left_rotation_of_a_string_s4
sfo_58ii_left_rotation_of_a_string_s4
sfo_58ii_left_rotation_of_a_string_s5
sfo_58ii_left_rotation_of_a_string_s5
sfo_59i_sliding_window_maximum_s1
sfo_59i_sliding_window_maximum_s1
View all files
You can’t perform that action at this time.