Skip to content

About

This repo contains all my leetcode solutions in C++.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

160 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Solutions

A collection of my LeetCode solutions in C++, focused on Data Structures & Algorithms (DSA) and problem-solving.

This repository documents my journey of practicing programming problems and improving my algorithmic thinking through hands-on problem solving.


About This Repository

I am currently a Software Engineering student @ PUCIT, and this repository contains the LeetCode problems I have solved while practicing programming and DSA.


Problem Index

# Problem LeetCode Solution
1 Two Sum Problem 0001_two_sum.cpp
3 Longest Substring Without Repeating Characters Problem 0003_longest_substring_without_repeating_characters.cpp
4 Median of Two Sorted Arrays Problem 0004_median_of_two_sorted_arrays.cpp
7 Reverse Integer Problem 0007_reverse_integer.cpp
8 String to Integer (atoi) Problem 0008_string_to_integer_atoi.cpp
9 Palindrome Number Problem 0009_palindrome_number.cpp
11 Container With Most Water Problem 0011_container_with_most_water.cpp
12 Integer to Roman Problem 0012_integer_to_roman.cpp
13 Roman to Integer Problem 0013_roman_to_integer.cpp
14 Longest Common Prefix Problem 0014_longest_common_prefix.cpp
20 Valid Parentheses Problem 0020_valid_parentheses.cpp
26 Remove Duplicates from Sorted Array Problem 0026_remove_duplicates_from_sorted_array.cpp
27 Remove Element Problem 0027_remove_element.cpp
28 Find the Index of the First Occurrence in a String Problem 0028_find_the_index_of_the_first_occurrence_in_a_string.cpp
33 Search in Rotated Sorted Array Problem 0033_search_in_rotated_sorted_array.cpp
35 Search Insert Position Problem 0035_search_insert_position.cpp
50 Pow(x, n) Problem 0050_powx-n.cpp
53 Maximum Subarray Problem 0053_maximum_subarray.cpp
58 Length of Last Word Problem 0058_length_of_last_word.cpp
66 Plus One Problem 0066_plus_one.cpp
67 Add Binary Problem 0067_add_binary.cpp
69 Sqrt(x) Problem 0069_sqrt(x).cpp
70 Climbing Stairs Problem 0070_climbing_stairs.cpp
88 Merge Sorted Array Problem 0088_merge_sorted_array.cpp
118 Pascal's Triangle Problem 0118_pascals_triangle.cpp
119 Pascal's Triangle II Problem 0119_pascals_triangle_ii.cpp
121 Best Time to Buy and Sell Stock Problem 0121_best_time_to_buy_and_sell_stock.cpp
125 Valid Palindrome Problem 0125_valid_palindrome.cpp
136 Single Number Problem 0136_single_number.cpp
168 Excel Sheet Column Title Problem 0168_excel_sheet_column_title.cpp
169 Majority Element Problem 0169_majority_element.cpp
171 Excel Sheet Column Number Problem 0171_excel_sheet_column_number.cpp
191 Number of 1 Bits Problem 0191_number_of_1_bits.cpp
202 Happy Number Problem 0202_happy_number.cpp
217 Contains Duplicate Problem 0217_contains_duplicate.cpp
231 Power of Two Problem 0231_power_of_two.cpp
238 Product of Array Except Self Problem 0238_product_of_array_except_self.cpp
242 Valid Anagram Problem 0242_valid_anagram.cpp
258 Add Digits Problem 0258_add_digits.cpp
263 Ugly Number Problem 0263_ugly_number.cpp
268 Missing Number Problem 0268_missing_number.cpp
283 Move Zeroes Problem 0283_move_zeroes.cpp
326 Power of Three Problem 0326_power_of_three.cpp
338 Counting Bits Problem 0338_counting_bits.cpp
342 Power of Four Problem 0342_power_of_four.cpp
344 Reverse String Problem 0344_reverse_string.cpp
349 Intersection of Two Arrays Problem 0349_intersection_of_two_arrays.cpp
367 Valid Perfect Square Problem 0367_valid_perfect_square.cpp
389 Find the Difference Problem 0389_find_the_difference.cpp
412 Fizz Buzz Problem 0412_fizz_buzz.cpp
415 Add Strings Problem 0415_add_strings.cpp
441 Arranging Coins Problem 0441_arranging_coins.cpp
476 Number Complement Problem 0476_number_complement.cpp
485 Max Consecutive Ones Problem 0485_max_consecutive_ones.cpp
504 Base 7 Problem 0504_base_7.cpp
507 Perfect Number Problem 0507_perfect_number.cpp
509 Fibonacci Number Problem 0509_fibonacci_number.cpp
520 Detect Capital Problem 0520_detect_capital.cpp
599 Minimum Index Sum of Two Lists Problem 0599_minimum_index_sum_of_two_lists.cpp
657 Robot Return to Origin Problem 0657_robot_return_to_origin.cpp
728 Self Dividing Numbers Problem 0728_self_dividing_numbers.cpp
806 Number of Lines To Write String Problem 0806_number_of_lines_to_write_string.cpp
867 Transpose Matrix Problem 0867_transpose_matrix.cpp
977 Squares of a Sorted Array Problem 0977_squares_of_a_sorted_array.cpp
989 Add to Array-Form of Integer Problem 0989_add_to_array_form_of_integer.cpp
1342 Number of Steps to Reduce a Number to Zero Problem 1342_number_of_steps_to_reduce_a_number_to_zero.cpp
1346 Check If N and Its Double Exist Problem 1346_check_if_n_and_its_double_exist.cpp
1446 Consecutive Characters Problem 1446_consecutive_characters.cpp
1528 Shuffle String Problem 1528_shuffle_string.cpp
1629 Slowest Key Problem 1629_slowest_key.cpp
1672 Richest Customer Wealth Problem 1672_richest_customer_wealth.cpp
1688 Count of Matches in Tournament Problem 1688_count_of-matches_in_tournament.cpp
1945 Sum of Digits of String After Convert Problem 1945_sum_of_digits_of_string_after_convert.cpp
2119 A Number After a Double Reversal Problem 2119_a_number_after_a_double_reversal.cpp
2154 Keep Multiplying Found Values by Two Problem 2154_keep_multiplying_found_values_by_two.cpp
2235 Add Two Integers Problem 2235_add_two_integers.cpp
2413 Smallest Even Multiple Problem 2413_smallest_even_multiple.cpp
2427 Number of Common Factors Problem 2427_number_of_common_factors.cpp
2455 Average Value of Even Numbers That Are Divisible by Three Problem 2455_average_value_of_even_numbers_that_are_divisible_by_three.cpp
2643 Row With Maximum Ones Problem 2643_row_with_maximum_ones.cpp
2778 Sum of Squares of Special Elements Problem 2778_sum_of_squares_of_special_elements.cpp
3345 Smallest Divisible Digit Product I Problem 3345_smallest_divisible_digit_product_i.cpp
3678 Smallest Absent Positive Greater Than Average Problem 3678_smallest_absent_positive_greater_than_average.cpp

Code Checking

Use code_check.cpp to test solutions locally.

g++ code_check.cpp
.\a.exe

Replace the solution and test case in code_check.cpp as needed.


Note

These solutions represent my own learning and problem-solving practice and may not always be the most optimal.

The goal is to understand the problem, develop a working approach, analyze it, and improve over time.


More problems and solutions will be added as I continue my coding journey.

About

This repo contains all my leetcode solutions in C++.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages