Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 2.46 KB

Day 21 - LeetCode Easy Assignment.md

File metadata and controls

44 lines (36 loc) · 2.46 KB

Day 21: LeetCode Easy

Tasks/Activities:

Activity 1: Two Sum

  • Task 1: Solve the "Two Sum" problem on LeetCode.
    • Write a function that takes an array of numbers and a target number, and returns the indices of the two numbers that add up to the target.
    • Log the indices for a few test cases.

Activity 2: Reverse Integer

  • Task 2: Solve the "Reverse Integer" problem on LeetCode.
    • Write a function that takes an integer and returns it with its digits reversed.
    • Handle edge cases like negative numbers and numbers ending in zero.
    • Log the reversed integers for a few test cases.

Activity 3: Palindrome Number

  • Task 3: Solve the "Palindrome Number" problem on LeetCode.
    • Write a function that takes an integer and returns true if it is a palindrome, and false otherwise.
    • Log the result for a few test cases, including edge cases like negative numbers.

Activity 4: Merge Two Sorted Lists

  • Task 4: Solve the "Merge Two Sorted Lists" problem on LeetCode.
    • Write a function that takes two sorted linked lists and returns a new sorted list by merging them.
    • Create a few test cases with linked lists and log the merged list.

Activity 5: Valid Parentheses

  • Task 5: Solve the "Valid Parentheses" problem on LeetCode.
    • Write a function that takes a string containing just the characters '(', ')', '{', '}', '[' and ']', and determines if the input string is valid.
    • A string is valid if open brackets are closed in the correct order.
    • Log the result for a few test cases.

Feature Request:

  1. Two Sum Script: Write a script that includes a function to solve the "Two Sum" problem and logs the indices of the two numbers.
  2. Reverse Integer Script: Create a script that includes a function to reverse an integer and handles edge cases.
  3. Palindrome Number Script: Write a script that includes a function to check if an integer is a palindrome and logs the result.
  4. Merge Two Sorted Lists Script: Create a script that includes a function to merge two sorted linked lists and logs the merged list.
  5. Valid Parentheses Script: Write a script that includes a function to check if a string of parentheses is valid and logs the result.

Achievement:

By the end of these activities, students will:

  • Solve common LeetCode problems.
  • Apply problem-solving skills to implement algorithms.
  • Understand and handle edge cases in algorithmic solutions.
  • Gain confidence in solving easy-level coding challenges on LeetCode.