A collection of algorithmic exercises where I solve common coding challenges using JavaScript, focusing on problem-solving, algorithmic thinking, and code implementation. The project includes tests and edge case handling for each solution.
- Description: Sort a list of numbers using two different methods: insertion sort and selection sort.
- Objective: Implement two separate functions that output a sorted array.
- Example Input:
[100, 95, 10, -10, 32, -55, 44, 10, 33, -564] - Example Output:
[-564, -55, -10, 10, 10, 32, 33, 44, 95, 100]
- Description: Given a list of numbers and a target sum, determine if any two numbers add up to the target.
- Objective: Return
trueif a valid pair is found, otherwisefalse. - Example Input:
list = [10, 15, 3, 7], k = 17 - Example Output:
true(10 + 7 = 17)
- Description: Encode a string using run-length encoding, which compresses repeated characters into a single count and character. Implement decoding as well.
- Objective: Write functions for both encoding and decoding strings.
- Example Input:
"AAAABBBCCDAA" - Example Output:
"4A3B2C1D2A"
- Description: Check if a string of round
(), curly{}, and square[]brackets is balanced. - Objective: Return
trueif the brackets are well-formed, otherwisefalse. - Example Input:
"([])" - Example Output:
true