Activity 1: Add Two Numbers
-
Task 1: Solve the 'Add Two Numbers" problem on LeetCode.
- Write a function that takes two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each node contains a single digit. Add the two numbers and return the sum as a linked list.
- Create a few test cases with linked lists and log the sum as a linked list.
Activity 2: Longest Substring Without Repeating Characters
-
Task 2: Solve the "Longest Substring Without Repeating Characters' problem on LeetCode.
- Write a function that takes a string and returns the length of the longest substring without repeating characters.
- Log the length for a few test cases, including edge cases.
Activity 3: Container With Most Water
-
Task 3: Solve the "Container With Most Water" problem on LeetCode.
- Write a function that takes an array of non-negative integers where each integer represents the height of a line drawn at each point. Find two lines that together with the x-axis form a container, such that the container holds the most water.
- Log the maximum amount of water for a few test cases.
Activity 4: 3Sum
-
Task 4: Solve the 3Sum problem on LeetCode.
- Write a function that takes an array of integers and finds all unique triplets in the array which give the sum of zero.
- Log the triplets for a few test cases, including edge cases.
Activity 5: Group Anagrams
-
Task 5: Solve the "Group Anagrams" problem on LeetCode.
- Write a function that takes an array of strings and groups anagrams together.
- Log the grouped anagrams for a few test cases.
-
Add Two Numbers Script: Write a script that includes a function to solve the "Add Two Numbers problem and logs the sum as a linked list.
-
Longest Substring Script: Create a script that includes a function to find the longest substring without repeating characters and logs the length.
-
Container With Most Water Script: Write a script that includes a function to find the container with the most water and logs the maximum amount of water.
-
3Sum Script: Create a script that includes a function to find all unique triplets in an array that sum to zero and logs the triplets.
-
Group Anagrams Script: Write a script that includes a function to group anagrams and logs the grouped anagrams.
By the end of these activities, you will:
-
Solve common medium-level LeetCode problems.
-
Apply advanced problem-solving skills to implement algorithms.
-
Understand and handle edge cases in more complex algorithmic solutions.
-
Gain confidence in solving medium-level coding challenges on LeetCode.
