If you really want to learn C and improve through the challenges, don't just copy my solutions. You won't learn anything that way! (Cheating and plagiarizing is not permitted on the LeetCode website. Violators will face account suspension or ban.)
My solutions to some LeetCode challenges, programmed in C, might not be the most sophisticated, but at least mostly easy to read and understand. However, a few are implemented rather poorly.
The code I released here into the public domain may appear in third-party projects. I do not maintain, endorse, or have any affiliation with such projects. Any malicious or deceptive use is unauthorized and should be reported to the hosting platform.
- #0001 - Easy - Two Sum - Solution: two_sum.c
- #0002 - Medium - Add Two Numbers - Solution: add_two_numbers.c
- #0003 - Medium - Longest Substring Without Repeating Characters - Solution: longest_substring_without_repeating_characters.c
- #0004 - Hard - Median of Two Sorted Arrays - Solution: median_of_two_sorted_arrays.c
- #0005 - Medium - Longest Palindromic Substring - Solution: longest_palindromic_substring.c
- #0006 - Medium - Zigzag Conversion - Solution: zigzag_conversion.c
- #0007 - Medium - Reverse Integer - Solution: reverse_integer.c
- #0008 - Medium - String to Integer (atoi) - Solution: string_to_integer.c
- #0009 - Easy - Palindrome Number - Solution: palindrome_number.c
- #0011 - Medium - Container With Most Water - Solution: container_with_most_water.c
- #0014 - Easy - Longest Common Prefix - Solution: longest_common_prefix.c
- #0019 - Medium - Remove Nth Node From End of List - Solution: remove_nth_node_from_end_of_list.c
- #0020 - Easy - Valid Parentheses - Solution: valid_parentheses.c
- #0021 - Easy - Merge Two Sorted Lists - Solution: merge_two_sorted_lists.c
- #0026 - Easy - Remove Duplicates from Sorted Array - Solution: remove_duplicates_from_sorted_array.c
- #0069 - Easy - Sqrt(x) - Solution: sqrt_x.c
- #0083 - Easy - Remove Duplicates from Sorted List - Solution: remove_duplicates_from_sorted_list.c
- #0088 - Easy - Merge Sorted Array - Solution: merge_sorted_array.c
- #0148 - Medium - Sort List - Solution: sort_list.c
- #0206 - Easy - Reverse Linked List - Solution: reverse_linked_list.c
