{"id":22994389,"url":"https://github.com/amreshpro/pro150problems","last_synced_at":"2026-01-12T06:41:53.644Z","repository":{"id":266315345,"uuid":"898006634","full_name":"amreshpro/pro150problems","owner":"amreshpro","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-03T16:17:14.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T03:42:51.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amreshpro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T16:12:44.000Z","updated_at":"2024-12-03T16:19:49.000Z","dependencies_parsed_at":"2024-12-03T17:29:06.588Z","dependency_job_id":"ad0977b2-bfb5-4e3f-94a5-b047569e3638","html_url":"https://github.com/amreshpro/pro150problems","commit_stats":null,"previous_names":["amreshpro/pro150problems"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amreshpro%2Fpro150problems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amreshpro%2Fpro150problems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amreshpro%2Fpro150problems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amreshpro%2Fpro150problems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amreshpro","download_url":"https://codeload.github.com/amreshpro/pro150problems/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246819741,"owners_count":20839094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T05:18:27.337Z","updated_at":"2026-01-12T06:41:53.607Z","avatar_url":"https://github.com/amreshpro.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 150 Pro Problems\n\n## Level 1\n1. **Determining Even/Odd Numbers**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming  \n   **Description**: Write a program to check whether a number is even or odd.  \n   **Example**:  \n   Input: `number = 4`  \n   Output: `Even`  \n   Explanation: Since 4 is divisible by 2, it is an even number.  \n\n2. **Checking for Prime Numbers**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Number Theory  \n   **Description**: Write a program to determine if a number is prime.  \n   **Example**:  \n   Input: `number = 7`  \n   Output: `Prime`  \n   Explanation: 7 has no divisors other than 1 and itself, so it is a prime number.  \n\n3. **Validating Leap Years**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Date Handling  \n   **Description**: Write a program to check if a given year is a leap year.  \n   **Example**:  \n   Input: `year = 2020`  \n   Output: `Leap Year`  \n   Explanation: 2020 is divisible by 4 but not by 100, or it is divisible by 400, so it is a leap year.  \n\n4. **Calculating Armstrong Numbers**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Number Theory  \n   **Description**: Write a program to check if a number is an Armstrong number.  \n   **Example**:  \n   Input: `number = 153`  \n   Output: `Armstrong Number`  \n   Explanation: 153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153.  \n\n5. **Generating the Fibonacci Series**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Sequences  \n   **Description**: Write a program to generate the Fibonacci series up to a given number.  \n   **Example**:  \n   Input: `limit = 10`  \n   Output: `[0, 1, 1, 2, 3, 5, 8]`  \n   Explanation: The Fibonacci series up to 10 is generated as [0, 1, 1, 2, 3, 5, 8].  \n\n6. **Identifying Palindromes**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, String Manipulation  \n   **Description**: Write a program to check if a string or number is a palindrome.  \n   **Example**:  \n   Input: `string = \"radar\"`  \n   Output: `Palindrome`  \n   Explanation: \"radar\" reads the same backward as forward.  \n\n7. **Crafting Star Patterns**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Patterns  \n   **Description**: Write a program to create different star patterns (e.g., pyramid, diamond).  \n   **Example**:  \n   Input: `patternType = \"pyramid\", height = 5`  \n   Output:  \n   ```\n       *\n      ***\n     *****\n    *******\n   *********\n   ```  \n   Explanation: A pyramid pattern with a height of 5 is generated.\n\n8. **Finding the Factorial of a Number**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Mathematical Computations  \n   **Description**: Write a program to compute the factorial of a given number.  \n   **Example**:  \n   Input: `number = 5`  \n   Output: `120`  \n   Explanation: 5! (factorial) is 5 × 4 × 3 × 2 × 1 = 120.  \n\n9. **Summing Digits of a Number**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Mathematical Computations  \n   **Description**: Write a program to calculate the sum of digits of a number.  \n   **Example**:  \n   Input: `number = 1234`  \n   Output: `10`  \n   Explanation: The sum of the digits 1 + 2 + 3 + 4 = 10.  \n\n10. **Finding the Greatest Common Divisor (GCD)**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to find the GCD of two numbers.  \n    **Example**:  \n    Input: `a = 48, b = 18`  \n    Output: `6`  \n    Explanation: The GCD of 48 and 18 is 6.\n\n11. **Finding the Least Common Multiple (LCM)**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to find the LCM of two numbers.  \n    **Example**:  \n    Input: `a = 12, b = 15`  \n    Output: `60`  \n    Explanation: The LCM of 12 and 15 is 60.  \n\n12. **Counting Vowels and Consonants in a String**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, String Manipulation  \n    **Description**: Write a program to count vowels and consonants in a given string.  \n    **Example**:  \n    Input: `string = \"hello world\"`  \n    Output: `Vowels: 3, Consonants: 7`  \n    Explanation: \"hello world\" contains 3 vowels (e, o, o) and 7 consonants (h, l, l, w, r, l, d).  \n\n13. **Reversing a String**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, String Manipulation  \n    **Description**: Write a program to reverse a given string.  \n    **Example**:  \n    Input: `string = \"programming\"`  \n    Output: `\"gnimmargorp\"`  \n    Explanation: The reversed string of \"programming\" is \"gnimmargorp\".  \n\n14. **Finding the Largest and Smallest Numbers in an Array**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Arrays  \n    **Description**: Write a program to find the largest and smallest numbers in an array.  \n    **Example**:  \n    Input: `array = [4, 7, 1, 8, 5]`  \n    Output: `Largest: 8, Smallest: 1`  \n    Explanation: The largest number in the array is 8 and the smallest is 1.  \n\n15. **Sorting an Array**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Sorting Algorithms  \n    **Description**: Write a program to sort an array of numbers in ascending order.  \n    **Example**:  \n    Input: `array = [3, 1, 4, 1, 5, 9]`  \n    Output: `[1, 1, 3, 4, 5, 9]`  \n    Explanation: The array sorted in ascending order is [1, 1, 3, 4, 5, 9].  \n\n16. **Finding the Sum of Elements in an Array**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Arrays  \n    **Description**: Write a program to find the sum of elements in an array.  \n    **Example**:  \n    Input: `array = [1, 2, 3, 4, 5]`  \n    Output: `15`  \n    Explanation: The sum of the elements in the array is 15.  \n\n17. **Checking for Armstrong Numbers in a Range**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to find all Armstrong numbers within a given range.  \n    **Example**:  \n    Input: `range = [1, 500]`  \n    Output: `[1, 153, 370, 371, 407]`  \n    Explanation: Armstrong numbers between 1 and 500 are 1, 153, 370, 371, and 407.  \n\n18. **Generating Multiplication Tables**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to generate multiplication tables for a given number.  \n    **Example**:  \n    Input: `number = 4`  \n    Output:  \n    ```\n    4 x 1 = 4  \n    4 x 2 = 8  \n    4 x 3 = 12  \n    4 x 4 = 16  \n    4 x 5 = 20  \n    ```  \n    Explanation: The multiplication table for 4 up to 5 is generated.  \n\n19. **Finding Prime Numbers in a Range**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to find all prime numbers within a given range.  \n    **Example**:  \n    Input: `range = [10, 30]`  \n    Output: `[11, 13, 17, 19, 23, 29]`  \n    Explanation: Prime numbers between 10 and 30 are 11, 13, 17, 19, 23, and 29.  \n\n20. **Checking for Perfect Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to determine if a number is a perfect number.  \n    **Example**:  \n    Input: `number = 28`  \n    Output: `Perfect Number`  \n    Explanation: 28 is a perfect number because its divisors (1, 2, 4, 7, 14) sum up to 28.\n\n21. **Calculating the Sum of Even Numbers in a Range**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to find the sum of all even numbers within a given range.  \n    **Example**:  \n    Input: `range = [1, 10]`  \n    Output: `30`  \n    Explanation: The sum of even numbers between 1 and 10 is 2 + 4 + 6 + 8 + 10 = 30.  \n\n22. **Calculating the Sum of Odd Numbers in a Range**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to find the sum of all odd numbers within a given range.  \n    **Example**:  \n    Input: `range = [1, 10]`  \n    Output: `25`  \n    Explanation: The sum of odd numbers between 1 and 10 is 1 + 3 + 5 + 7 + 9 = 25.  \n\n23. **Finding the Fibonacci Number at a Specific Position**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Sequences  \n    **Description**: Write a program to find the Fibonacci number at a specific position.  \n    **Example**:  \n    Input: `position = 5`  \n    Output: `5`  \n    Explanation: The Fibonacci number at position 5 is 5 (sequence: 0, 1, 1, 2, 3, 5).  \n\n24. **Printing Prime Numbers Less Than a Given Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to print all prime numbers less than a given number.  \n    **Example**:  \n    Input: `number = 20`  \n    Output: `2, 3, 5, 7, 11, 13, 17, 19`  \n    Explanation: The prime numbers less than 20 are 2, 3, 5, 7, 11, 13, 17, and 19.  \n\n25. **Finding the Number of Digits in a Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to count the number of digits in a given number.  \n    **Example**:  \n    Input: `number = 12345`  \n    Output: `5`  \n    Explanation: The number 12345 has 5 digits.  \n\n26. **Checking if a Number is a Narcissistic Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Number Theory  \n    **Description**: Write a program to check if a number is a narcissistic number (where the sum of its digits raised to the power of the number of digits equals the number itself).  \n    **Example**:  \n    Input: `number = 153`  \n    Output: `Narcissistic Number`  \n    Explanation: 153 is a narcissistic number because 1^3 + 5^3 + 3^3 = 153.  \n\n27. **Generating a Pattern of Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Patterns  \n    **Description**: Write a program to generate number patterns (e.g., sequential numbers in a matrix).  \n    **Example**:  \n    Input: `rows = 3`  \n    Output:  \n    ```\n    1  \n    2 3  \n    4 5 6  \n    ```  \n    Explanation: A number pattern with 3 rows is generated.  \n\n28. **Finding the Sum of the Digits of the Factorial of a Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to find the sum of the digits of the factorial of a given number.  \n    **Example**:  \n    Input: `number = 4`  \n    Output: `9`  \n    Explanation: The factorial of 4 is 24, and the sum of the digits (2 + 4) is 6.  \n\n29. **Finding the Largest Palindrome in a String**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, String Manipulation  \n    **Description**: Write a program to find the largest palindrome in a given string.  \n    **Example**:  \n    Input: `string = \"babad\"`  \n    Output: `\"bab\"` or `\"aba\"`  \n    Explanation: Both \"bab\" and \"aba\" are valid palindromes in the string.  \n\n30. **Finding Missing Numbers in a Sequence**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Arrays  \n    **Description**: Write a program to find missing numbers in a sequence from 1 to n.  \n    **Example**:  \n    Input: `sequence = [1, 2, 4, 5]`  \n    Output: `[3]`  \n    Explanation: The missing number in the sequence from 1 to 5 is 3.  \n\n31. **Generating a Pascal’s Triangle**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Mathematical Computations  \n    **Description**: Write a program to generate Pascal's Triangle up to a given number of rows.  \n    **Example**:  \n    Input: `rows = 4`  \n    Output:  \n    ```\n    1  \n    1 1  \n    1 2 1  \n    1 3 3 1  \n    ```  \n    Explanation: Pascal's Triangle with 4 rows is generated.  \n\n32. **Finding the Median of an Array**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Sorting  \n    **Description**: Write a program to find the median of an array of numbers.  \n    **Example**:  \n    Input: `array = [3, 1, 2, 4, 5]`  \n    Output: `3`  \n    Explanation: The median of the sorted array [1, 2, 3, 4, 5] is 3.  \n\n33. **Calculating the Power of a Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to calculate the power of a number.  \n    **Example**:  \n    Input: `base = 2`, `exponent = 3`  \n    Output: `8`  \n    Explanation: 2 raised to the power of 3 is 8.  \n\n34. **Checking for an Anagram**  \n    **Difficulty**: Easy  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to check if two strings are anagrams.  \n    **Example**:  \n    Input: `string1 = \"listen\"`, `string2 = \"silent\"`  \n    Output: `True`  \n    Explanation: \"listen\" and \"silent\" are anagrams of each other.  \n\n35. **Finding the Sum of Prime Numbers in a Range**  \n    **Difficulty**: Medium  \n    **Topics**: Number Theory, Mathematical Computations  \n    **Description**: Write a program to calculate the sum of all prime numbers within a given range.  \n    **Example**:  \n    Input: `range = [1, 10]`  \n    Output: `17`  \n    Explanation: The sum of prime numbers between 1 and 10 is 2 + 3 + 5 + 7 = 17.  \n\n36. **Finding the N-th Triangular Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to find the N-th triangular number.  \n    **Example**:  \n    Input: `N = 4`  \n    Output: `10`  \n    Explanation: The 4th triangular number is 10 (sum of the first 4 natural numbers).  \n\n37. **Checking for Perfect Squares**  \n    **Difficulty**: Easy  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to determine if a number is a perfect square.  \n    **Example**:  \n    Input: `number = 16`  \n    Output: `True`  \n    Explanation: 16 is a perfect square (4^2 = 16).  \n\n38. **Finding the Sum of Squares of Digits**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to find the sum of the squares of the digits of a number.  \n    **Example**:  \n    Input: `number = 123`  \n    Output: `14`  \n    Explanation: The sum of the squares of digits is 1^2 + 2^2 + 3^2 = 14.  \n\n39. **Generating a Square Matrix of a Given Size**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Matrix Operations  \n    **Description**: Write a program to generate a square matrix of a given size and fill it with sequential numbers.  \n    **Example**:  \n    Input: `size = 3`  \n    Output:  \n    ```\n    1 2 3  \n    4 5 6  \n    7 8 9  \n    ```  \n    Explanation: A 3x3 matrix is generated with sequential numbers.  \n\n40. **Calculating the Sum of Digits of a Number Until Single Digit**  \n    **Difficulty**: Medium  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to keep summing the digits of a number until a single digit is obtained.  \n    **Example**:  \n    Input: `number = 9875`  \n    Output: `2`  \n    Explanation: The sum of digits is 9 + 8 + 7 + 5 = 29, and then 2 + 9 = 11, and finally 1 + 1 = 2.  \n\n41. **Finding the Count of Specific Digits in a Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, String Manipulation  \n    **Description**: Write a program to count the occurrences of a specific digit in a number.  \n    **Example**:  \n    Input: `number = 122333`, `digit = 3`  \n    Output: `3`  \n    Explanation: The digit 3 occurs 3 times in the number 122333.  \n\n42. **Generating a Fibonacci Sequence Using Recursion**  \n    **Difficulty**: Medium  \n    **Topics**: Recursion, Sequences  \n    **Description**: Write a recursive program to generate the Fibonacci sequence up to a given number.  \n    **Example**:  \n    Input: `number = 5`  \n    Output: `0, 1, 1, 2, 3`  \n    Explanation: The Fibonacci sequence up to 5 is generated.  \n\n43. **Finding All Divisors of a Number**  \n    **Difficulty**: Easy  \n    **Topics**: Basic Programming, Mathematical Computations  \n    **Description**: Write a program to find all divisors of a given number.  \n    **Example**:  \n    Input: `number = 12`  \n    Output: `1, 2, 3, 4, 6, 12`  \n    Explanation: The divisors of 12 are 1, 2, 3, 4, 6, and 12.  \n\n44. **Finding the Average of Numbers in an Array**  \n    **Difficulty**: Easy  \n    **Topics**: Arrays, Mathematical Computations  \n    **Description**: Write a program to calculate the average of numbers in an array.  \n    **Example**:  \n    Input: `array = [1, 2, 3, 4, 5]`  \n    Output: `3`  \n    Explanation: The average of the numbers is (1 + 2 + 3 + 4 + 5) / 5 = 3.  \n\n45. **Finding the Mode of Numbers in an Array**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Statistical Analysis  \n    **Description**: Write a program to find the mode (most frequent number) in an array.  \n    **Example**:  \n    Input: `array = [1, 2, 2, 3, 4, 4, 4]`  \n    Output: `4`  \n    Explanation: The most frequent number in the array is 4.  \n\n46. **Determining the Length of a String Without Using Built-In Functions**  \n    **Difficulty**: Medium  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to determine the length of a string without using built-in functions.  \n    **Example**:  \n    Input: `string = \"hello\"`  \n    Output: `5`  \n    Explanation: The length of the string \"hello\" is determined without using built-in functions.  \n\n47. **Generating a Number Pyramid**  \n    **Difficulty**: Medium  \n    **Topics**: Patterns, Basic Programming  \n    **Description**: Write a program to generate a pyramid of numbers (e.g., 1, 12, 123, etc.).  \n    **Example**:  \n    Input: `rows = 4`  \n    Output:  \n    ```\n    1  \n    12  \n    123  \n    1234  \n    ```  \n    Explanation: A number pyramid with 4 rows is generated.  \n\n48. **Finding the Sum of Prime Factors of a Number**  \n    **Difficulty**: Medium  \n    **Topics**: Number Theory, Mathematical Computations  \n    **Description**: Write a program to find the sum of the prime factors of a given number.  \n    **Example**:  \n    Input: `number = 12`  \n    Output: `5`  \n    Explanation: The prime factors of 12 are 2 and 3, and their sum is 2 + 3 = 5.  \n\n49. **Finding the Second Largest Number in an Array**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Sorting  \n    **Description**: Write a program to find the second largest number in an array.  \n    **Example**:  \n    Input: `array = [10, 20, 4, 45, 99]`  \n    Output: `45`  \n    Explanation: The second largest number in the array is 45.  \n\n50. **Finding the Longest Substring Without Repeating Characters**  \n    **Difficulty**: Medium  \n    **Topics**: String Manipulation, Sliding Window  \n    **Description**: Write a program to find the longest substring without repeating characters in a given string.  \n    **Example**:  \n    Input: `string = \"abcabcbb\"`  \n    Output: `\"abc\"`  \n    Explanation: The longest substring without repeating characters is \"abc\".  \n\n\n## Level 2\n\n\n    1. **Finding the Sum of Digits of a Number Until Zero**  \n   **Difficulty**: Easy  \n   **Topics**: Basic Programming, Mathematical Computations  \n   **Description**: Write a program to repeatedly sum the digits of a number until the result is zero.  \n   **Example**:  \n   Input: `number = 123`  \n   Output: `6`  \n   Explanation: Sum of digits is 1 + 2 + 3 = 6; sum of digits of 6 is 6 (which is a single digit).\n\n2. **Generating a Multiplication Table for a Range**  \n   **Difficulty**: Easy  \n   **Topics**: Arrays, Basic Programming  \n   **Description**: Write a program to generate multiplication tables for numbers within a specified range.  \n   **Example**:  \n   Input: `start = 2`, `end = 4`  \n   Output:  \n   ```\n   2 x 1 = 2   3 x 1 = 3   4 x 1 = 4  \n   2 x 2 = 4   3 x 2 = 6   4 x 2 = 8  \n   2 x 3 = 6   3 x 3 = 9   4 x 3 = 12  \n   2 x 4 = 8   3 x 4 = 12  4 x 4 = 16  \n   ```\n\n3. **Calculating the Sum of a Series (1 + 1/2 + 1/3 + ... + 1/n)**  \n   **Difficulty**: Medium  \n   **Topics**: Mathematical Computations  \n   **Description**: Write a program to calculate the sum of the series 1 + 1/2 + 1/3 + ... + 1/n up to the nth term.  \n   **Example**:  \n   Input: `n = 4`  \n   Output: `2.083333`  \n   Explanation: Sum of the series is 1 + 1/2 + 1/3 + 1/4 ≈ 2.083333.\n\n4. **Finding All Pairs of Elements in an Array that Add Up to a Given Sum**  \n   **Difficulty**: Medium  \n   **Topics**: Arrays, Hashing  \n   **Description**: Write a program to find all pairs of elements in an array whose sum equals a specified target.  \n   **Example**:  \n   Input: `array = [1, 2, 3, 4, 5]`, `target = 5`  \n   Output: `[(1, 4), (2, 3)]`  \n   Explanation: Pairs that sum up to 5 are (1, 4) and (2, 3).\n\n5. **Generating a Diamond Pattern of Stars**  \n   **Difficulty**: Medium  \n   **Topics**: Patterns, Basic Programming  \n   **Description**: Write a program to create a diamond pattern with stars of a given size.  \n   **Example**:  \n   Input: `size = 5`  \n   Output:  \n   ```\n     *  \n    ***  \n   *****  \n    ***  \n     *  \n   ```\n\n6. **Counting the Number of Palindromic Substrings in a String**  \n   **Difficulty**: Medium  \n   **Topics**: String Manipulation  \n   **Description**: Write a program to count how many palindromic substrings exist in a given string.  \n   **Example**:  \n   Input: `string = \"aaa\"`  \n   Output: `6`  \n   Explanation: Palindromic substrings are \"a\", \"a\", \"a\", \"aa\", \"aa\", \"aaa\".\n\n7. **Generating a Matrix with Multiplication Table**  \n   **Difficulty**: Easy  \n   **Topics**: Arrays, Matrix Operations  \n   **Description**: Write a program to generate a matrix where each element at position (i, j) is the product of i and j.  \n   **Example**:  \n   Input: `size = 3`  \n   Output:  \n   ```\n   1 2 3  \n   2 4 6  \n   3 6 9  \n   ```\n\n8. **Finding the GCD of Multiple Numbers**  \n   **Difficulty**: Medium  \n   **Topics**: Mathematical Computations  \n   **Description**: Write a program to find the GCD (Greatest Common Divisor) of an array of numbers.  \n   **Example**:  \n   Input: `array = [12, 24, 36]`  \n   Output: `12`  \n   Explanation: The GCD of 12, 24, and 36 is 12.\n\n9. **Finding the Sum of the First N Odd Numbers**  \n   **Difficulty**: Easy  \n   **Topics**: Mathematical Computations  \n   **Description**: Write a program to calculate the sum of the first N odd numbers.  \n   **Example**:  \n   Input: `N = 5`  \n   Output: `25`  \n   Explanation: Sum of the first 5 odd numbers (1 + 3 + 5 + 7 + 9) is 25.\n\n10. **Finding the Number of Perfect Numbers Up to a Given Limit**  \n    **Difficulty**: Medium  \n    **Topics**: Number Theory  \n    **Description**: Write a program to find how many perfect numbers exist up to a given limit.  \n    **Example**:  \n    Input: `limit = 30`  \n    Output: `1`  \n    Explanation: There is only one perfect number (6) up to 30.\n\n11. **Finding the Largest Prime Factor of a Number**  \n    **Difficulty**: Medium  \n    **Topics**: Number Theory  \n    **Description**: Write a program to find the largest prime factor of a given number.  \n    **Example**:  \n    Input: `number = 28`  \n    Output: `7`  \n    Explanation: The prime factors of 28 are 2 and 7, with the largest being 7.\n\n12. **Generating a Matrix of Fibonacci Numbers**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Matrix Operations  \n    **Description**: Write a program to generate a matrix where each element is a Fibonacci number.  \n    **Example**:  \n    Input: `size = 3`  \n    Output:  \n    ```\n    1 1 2  \n    3 5 8  \n    13 21 34  \n    ```\n\n13. **Finding the Sum of the First N Prime Numbers**  \n    **Difficulty**: Medium  \n    **Topics**: Prime Numbers, Mathematical Computations  \n    **Description**: Write a program to calculate the sum of the first N prime numbers.  \n    **Example**:  \n    Input: `N = 4`  \n    Output: `17`  \n    Explanation: The sum of the first 4 prime numbers (2 + 3 + 5 + 7) is 17.\n\n14. **Checking for a Balanced Bracket Sequence**  \n    **Difficulty**: Medium  \n    **Topics**: String Manipulation, Stack  \n    **Description**: Write a program to check if a given string with brackets is balanced.  \n    **Example**:  \n    Input: `string = \"{[()]}\"`  \n    Output: `True`  \n    Explanation: The brackets are balanced.\n\n15. **Finding the Sum of Numbers in a String**  \n    **Difficulty**: Easy  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to extract and sum all numbers present in a given string.  \n    **Example**:  \n    Input: `string = \"The numbers are 12 and 34\"`  \n    Output: `46`  \n    Explanation: The sum of numbers 12 and 34 is 46.\n\n16. **Finding the Longest Consecutive Sequence in an Array**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Hashing  \n    **Description**: Write a program to find the longest sequence of consecutive numbers in an array.  \n    **Example**:  \n    Input: `array = [100, 4, 200, 1, 3, 2]`  \n    Output: `4`  \n    Explanation: The longest consecutive sequence is [1, 2, 3, 4].\n\n17. **Generating a Matrix with a Spiral Pattern**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Matrix Operations  \n    **Description**: Write a program to generate a matrix filled with numbers in a spiral pattern.  \n    **Example**:  \n    Input: `size = 3`  \n    Output:  \n    ```\n    1 2 3  \n    8 9 4  \n    7 6 5  \n    ```\n\n18. **Finding All Subsets of a Set**  \n    **Difficulty**: Medium  \n    **Topics**: Combinatorics  \n    **Description**: Write a program to generate all possible subsets of a given set of numbers.  \n    **Example**:  \n    Input: `set = [1, 2]`  \n    Output: `[[], [1], [2], [1, 2]]`  \n    Explanation: The subsets of [1, 2] are the empty set, [1], [2], and [1, 2].\n\n19. **Checking for Perfect Squares in a Range**  \n    **Difficulty**: Easy  \n    **Topics**: Mathematical Comput\n\nations  \n    **Description**: Write a program to check which numbers in a given range are perfect squares.  \n    **Example**:  \n    Input: `start = 1`, `end = 10`  \n    Output: `[1, 4, 9]`  \n    Explanation: Perfect squares between 1 and 10 are 1, 4, and 9.\n\n20. **Finding the Sum of Diagonal Elements in a Matrix**  \n    **Difficulty**: Easy  \n    **Topics**: Matrix Operations  \n    **Description**: Write a program to calculate the sum of the diagonal elements in a square matrix.  \n    **Example**:  \n    Input: `matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]`  \n    Output: `15`  \n    Explanation: The sum of the diagonal elements (1 + 5 + 9) is 15.\n\n21. **Finding the Second Smallest Number in an Array**  \n    **Difficulty**: Easy  \n    **Topics**: Arrays  \n    **Description**: Write a program to find the second smallest number in an array.  \n    **Example**:  \n    Input: `array = [12, 13, 1, 10, 34, 1]`  \n    Output: `10`  \n    Explanation: The second smallest number in the array is 10.\n\n22. **Generating Pascal’s Triangle Up to N Rows**  \n    **Difficulty**: Medium  \n    **Topics**: Combinatorics  \n    **Description**: Write a program to generate Pascal’s Triangle up to N rows.  \n    **Example**:  \n    Input: `N = 3`  \n    Output:  \n    ```\n    1  \n    1 1  \n    1 2 1  \n    ```\n\n23. **Finding the Sum of Digits of the Product of Two Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to find the sum of the digits of the product of two given numbers.  \n    **Example**:  \n    Input: `number1 = 12`, `number2 = 34`  \n    Output: `9`  \n    Explanation: The product of 12 and 34 is 408, and the sum of its digits is 4 + 0 + 8 = 12.\n\n24. **Checking for Palindromic Numbers in a Range**  \n    **Difficulty**: Medium  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to check for palindromic numbers within a given range.  \n    **Example**:  \n    Input: `start = 1`, `end = 100`  \n    Output: `[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99]`  \n    Explanation: Palindromic numbers between 1 and 100 are the numbers listed.\n\n25. **Generating a Matrix with Alternating 0s and 1s**  \n    **Difficulty**: Easy  \n    **Topics**: Arrays, Matrix Operations  \n    **Description**: Write a program to generate a matrix where the elements alternate between 0 and 1.  \n    **Example**:  \n    Input: `size = 3`  \n    Output:  \n    ```\n    0 1 0  \n    1 0 1  \n    0 1 0  \n    ```\n\n26. **Finding the Count of a Specific Word in a String**  \n    **Difficulty**: Easy  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to count how many times a specific word appears in a given string.  \n    **Example**:  \n    Input: `string = \"hello world hello\"`  \n    Output: `2`  \n    Explanation: The word \"hello\" appears 2 times in the string.\n\n27. **Finding the Largest Sum of a Subarray**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Dynamic Programming  \n    **Description**: Write a program to find the largest sum of any contiguous subarray.  \n    **Example**:  \n    Input: `array = [-2, 1, -3, 4, -1, 2, 1, -5, 4]`  \n    Output: `6`  \n    Explanation: The largest sum is 6, from the subarray `[4, -1, 2, 1]`.\n\n28. **Generating a Right-Angle Triangle Pattern of Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Patterns  \n    **Description**: Write a program to create a right-angle triangle pattern with numbers.  \n    **Example**:  \n    Input: `height = 4`  \n    Output:  \n    ```\n    1  \n    12  \n    123  \n    1234  \n    ```\n\n29. **Finding All Divisors of the Product of Two Numbers**  \n    **Difficulty**: Medium  \n    **Topics**: Number Theory  \n    **Description**: Write a program to find all divisors of the product of two given numbers.  \n    **Example**:  \n    Input: `number1 = 6`, `number2 = 10`  \n    Output: `[1, 2, 3, 5, 6, 10, 15, 30]`  \n    Explanation: The product of 6 and 10 is 60, and its divisors are listed.\n\n30. **Finding the Longest Sequence of Consecutive 1s in a Binary Array**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Binary Operations  \n    **Description**: Write a program to find the longest sequence of consecutive 1s in a binary array.  \n    **Example**:  \n    Input: `array = [1, 1, 0, 1, 1, 1]`  \n    Output: `3`  \n    Explanation: The longest sequence of 1s is `[1, 1, 1]` with length 3.\n\n31. **Calculating the Sum of the First N Fibonacci Numbers**  \n    **Difficulty**: Medium  \n    **Topics**: Fibonacci Sequence, Mathematical Computations  \n    **Description**: Write a program to calculate the sum of the first N Fibonacci numbers.  \n    **Example**:  \n    Input: `N = 5`  \n    Output: `12`  \n    Explanation: The first 5 Fibonacci numbers are 1, 1, 2, 3, 5, and their sum is 12.\n\n32. **Checking for a Repeated Substring in a String**  \n    **Difficulty**: Medium  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to check if a substring is repeated within a given string.  \n    **Example**:  \n    Input: `string = \"abab\"`  \n    Output: `True`  \n    Explanation: The substring \"ab\" is repeated.\n\n33. **Finding the Median of a List of Numbers**  \n    **Difficulty**: Medium  \n    **Topics**: Sorting, Mathematical Computations  \n    **Description**: Write a program to find the median value of a list of numbers.  \n    **Example**:  \n    Input: `list = [3, 1, 4, 1, 5]`  \n    Output: `3`  \n    Explanation: After sorting the list to [1, 1, 3, 4, 5], the median is 3.\n\n34. **Finding the Number of Words in a String**  \n    **Difficulty**: Easy  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to count the number of words in a given string.  \n    **Example**:  \n    Input: `string = \"Hello world\"`  \n    Output: `2`  \n    Explanation: There are 2 words in the string.\n\n35. **Generating a Matrix with a Diagonal Pattern**  \n    **Difficulty**: Medium  \n    **Topics**: Matrix Operations  \n    **Description**: Write a program to create a matrix where elements form diagonal lines of a given pattern.  \n    **Example**:  \n    Input: `size = 4`  \n    Output:  \n    ```\n    1 0 0 0  \n    1 1 0 0  \n    1 1 1 0  \n    1 1 1 1  \n    ```\n\n36. **Finding the Sum of the First N Even Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to calculate the sum of the first N even numbers.  \n    **Example**:  \n    Input: `N = 4`  \n    Output: `20`  \n    Explanation: The first 4 even numbers are 2, 4, 6, 8, and their sum is 20.\n\n37. **Finding the Count of Digits Greater Than a Specific Value**  \n    **Difficulty**: Easy  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to count how many digits in a number are greater than a specific value.  \n    **Example**:  \n    Input: `number = 54321`, `value = 3`  \n    Output: `2`  \n    Explanation: The digits\n\n greater than 3 in 54321 are 5, 4, and 4, so the count is 2.\n\n38. **Generating a Pattern of Prime Numbers**  \n    **Difficulty**: Medium  \n    **Topics**: Prime Numbers, Patterns  \n    **Description**: Write a program to generate a pattern where each row contains the first few prime numbers.  \n    **Example**:  \n    Input: `rows = 3`  \n    Output:  \n    ```\n    2  \n    2 3  \n    2 3 5  \n    ```\n\n39. **Finding the Common Elements in Two Arrays**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays  \n    **Description**: Write a program to find common elements between two arrays.  \n    **Example**:  \n    Input: `array1 = [1, 2, 3, 4]`, `array2 = [3, 4, 5, 6]`  \n    Output: `[3, 4]`  \n    Explanation: The common elements between the two arrays are 3 and 4.\n\n40. **Finding the Sum of the Squares of All Even Numbers Up to N**  \n    **Difficulty**: Medium  \n    **Topics**: Mathematical Computations  \n    **Description**: Write a program to calculate the sum of squares of all even numbers up to a given N.  \n    **Example**:  \n    Input: `N = 4`  \n    Output: `20`  \n    Explanation: The even numbers up to 4 are 2 and 4, and their squares are 4 and 16. The sum is 20.\n\n41. **Generating a Pattern of Increasing Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Patterns  \n    **Description**: Write a program to create a pattern where numbers increase with each row.  \n    **Example**:  \n    Input: `rows = 3`  \n    Output:  \n    ```\n    1  \n    12  \n    123  \n    ```\n\n42. **Finding the Largest Element in Each Row of a Matrix**  \n    **Difficulty**: Easy  \n    **Topics**: Matrix Operations  \n    **Description**: Write a program to find the largest element in each row of a matrix.  \n    **Example**:  \n    Input: `matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]`  \n    Output: `[3, 6, 9]`  \n    Explanation: The largest elements in each row are 3, 6, and 9.\n\n43. **Checking for Anagram Pairs in a List of Strings**  \n    **Difficulty**: Medium  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to find pairs of strings in a list that are anagrams of each other.  \n    **Example**:  \n    Input: `strings = [\"listen\", \"silent\", \"hello\", \"world\"]`  \n    Output: `[(\"listen\", \"silent\")]`  \n    Explanation: \"listen\" and \"silent\" are anagrams.\n\n44. **Finding the Frequency of Each Character in a String**  \n    **Difficulty**: Easy  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to count the frequency of each character in a given string.  \n    **Example**:  \n    Input: `string = \"hello\"`  \n    Output: `{'h': 1, 'e': 1, 'l': 2, 'o': 1}`  \n    Explanation: The frequency of each character in the string \"hello\" is shown.\n\n45. **Generating a Matrix with Random Numbers**  \n    **Difficulty**: Easy  \n    **Topics**: Random Number Generation, Matrix Operations  \n    **Description**: Write a program to generate a matrix filled with random numbers.  \n    **Example**:  \n    Input: `rows = 2`, `columns = 3`  \n    Output:  \n    ```\n    3 8 1  \n    7 4 6  \n    ```\n\n46. **Finding the Length of the Longest Word in a String**  \n    **Difficulty**: Easy  \n    **Topics**: String Manipulation  \n    **Description**: Write a program to find the length of the longest word in a given string.  \n    **Example**:  \n    Input: `string = \"Find the longest word\"`  \n    Output: `8`  \n    Explanation: The longest word is \"longest\" with length 8.\n\n47. **Finding All Triplets in an Array That Sum to Zero**  \n    **Difficulty**: Medium  \n    **Topics**: Arrays, Sorting  \n    **Description**: Write a program to find all unique triplets in an array that sum to zero.  \n    **Example**:  \n    Input: `array = [-1, 0, 1, 2, -1, -4]`  \n    Output: `[[-1, -1, 2], [-1, 0, 1]]`  \n    Explanation: The unique triplets that sum to zero are listed.\n\n48. **Generating a Square Matrix with Random Values**  \n    **Difficulty**: Easy  \n    **Topics**: Random Number Generation, Matrix Operations  \n    **Description**: Write a program to generate a square matrix where each element is a random value.  \n    **Example**:  \n    Input: `size = 3`  \n    Output:  \n    ```\n    7 3 5  \n    2 6 9  \n    1 8 4  \n    ```\n\n49. **Finding the Difference Between the Sum of Even and Odd Numbers in an Array**  \n    **Difficulty**: Easy  \n    **Topics**: Arrays, Mathematical Computations  \n    **Description**: Write a program to calculate the difference between the sum of even and odd numbers in an array.  \n    **Example**:  \n    Input: `array = [1, 2, 3, 4, 5, 6]`  \n    Output: `4`  \n    Explanation: The sum of even numbers is 12, and the sum of odd numbers is 8. The difference is 4.\n\n50. **Generating a Triangle Pattern of Stars with a Given Height**  \n    **Difficulty**: Easy  \n    **Topics**: Patterns  \n    **Description**: Write a program to create a triangle pattern of stars with a specified height.  \n    **Example**:  \n    Input: `height = 4`  \n    Output:  \n    ```\n    *  \n    **  \n    ***  \n    ****  \n    ```\n\n\n    ## Level 3\n\n    ### **Problem 1: Print a Right-Angle Triangle of Stars**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a right-angle triangle pattern of stars (`*`). Each row should contain an increasing number of stars, starting from 1 star in the first row.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\n*\n**\n***\n****\n```\n\n---\n\n### **Problem 2: Print a Square of Stars**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a square pattern of stars (`*`). Each row and column should have the same number of stars.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n*****\n*****\n*****\n*****\n*****\n```\n\n---\n\n### **Problem 3: Print a Pyramid Pattern**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a pyramid pattern with stars (`*`). The pyramid should have a single peak and each row should have an increasing number of stars, centered horizontally.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n```\n\n---\n\n### **Problem 4: Print a Diamond Pattern**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a diamond pattern with stars (`*`). The pattern should include a single peak in the middle with symmetric rows above and below it.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 5: Print a Hollow Square of Stars**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a hollow square pattern with stars (`*`). The border of the square should be filled with stars while the inner part should be empty.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n*****\n*   *\n*   *\n*   *\n*****\n```\n\n### **Problem 6: Print a Number Triangle**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a right-angle triangle pattern with numbers. Each row should contain an increasing sequence of numbers starting from 1.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\n1\n12\n123\n1234\n```\n\n---\n\n### **Problem 7: Print an Inverted Triangle Pattern**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print an inverted triangle pattern with stars (`*`). Each row should contain decreasing numbers of stars from the top row.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n*****\n ****\n  ***\n   **\n    *\n```\n\n---\n\n### **Problem 8: Print a Diamond Pattern with Numbers**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a diamond pattern with numbers. The pattern should have a peak in the middle with symmetric rows above and below it.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  1\n 121\n12321\n 121\n  1\n```\n\n---\n\n### **Problem 9: Print a Right-Angle Triangle of Numbers**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a right-angle triangle pattern with increasing numbers. Each row should contain a continuous sequence of increasing numbers.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\n1\n23\n456\n78910\n```\n\n---\n\n### **Problem 10: Print a Pyramid Pattern with Numbers**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a pyramid pattern with increasing numbers. Each row should have an increasing sequence of numbers, centered horizontally.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  1\n 232\n34543\n```\n\n---\n\n### **Problem 11: Print a Pattern of Alternating 0s and 1s**\n**Difficulty:** Medium  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix where elements alternate between `0` and `1`. The pattern should alternate both row-wise and column-wise.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\n0101\n1010\n0101\n1010\n```\n\n---\n\n### **Problem 12: Print a Pascal’s Triangle**\n**Difficulty:** Medium  \n**Topics:** Matrix Pattern  \n**Hint:** Print Pascal’s Triangle up to `N` rows. Each row should be constructed based on the sum of the elements directly above it in the previous row.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\n   1\n  1 1\n 1 2 1\n1 3 3 1\n```\n\n---\n\n### **Problem 13: Print a Pattern of Consecutive Numbers**\n**Difficulty:** Medium  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix of consecutive numbers starting from 1, filling rows sequentially.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1 2 3\n4 5 6\n7 8 9\n```\n\n---\n\n### **Problem 14: Print a Star Pattern with Increasing Width**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern where each row has an increasing width of stars.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n*\n***\n*****\n```\n\n---\n\n### **Problem 15: Print a Right-Angle Triangle Pattern with Characters**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a right-angle triangle pattern using characters. Each row should contain the same character repeated according to the row number.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\nA\nBB\nCCC\n```\n\n---\n\n### **Problem 16: Print a Checkerboard Pattern**\n**Difficulty:** Medium  \n**Topics:** Matrix Pattern  \n**Hint:** Print a checkerboard pattern with two different characters alternating.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\nXOXOXO\nOXOXOX\nXOXOXO\nOXOXOX\n```\n\n---\n\n### **Problem 17: Print a Pyramid Pattern of Increasing Stars**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pyramid pattern where each row increases in the number of stars.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n```\n\n---\n\n### **Problem 18: Print a Border Pattern with Numbers**\n**Difficulty:** Medium  \n**Topics:** Matrix Pattern  \n**Hint:** Print a border pattern using numbers. The border should be filled with numbers, and the inner part should be empty.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\n1234\n1  1\n1  1\n1234\n```\n\n---\n\n### **Problem 19: Print an Inverted Pyramid Pattern with Characters**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print an inverted pyramid pattern using characters. Each row should have decreasing characters from the top row.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\nCCC\n BB\n  A\n```\n\n---\n\n### **Problem 20: Print a Cross Pattern with Stars**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a cross pattern using stars. The cross should be centered within a matrix.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n***\n  *\n  *\n  *\n***\n```\n\n---\n\n### **Problem 21: Print a Spiral Matrix**\n**Difficulty:** Hard  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix filled with numbers in a spiral pattern. The numbers should start from 1 and increment as you move around the spiral.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1 2 3\n8 9 4\n7 6 5\n```\n\n---\n\n### **Problem 22: Print a Diamond Pattern with Increasing Width**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a diamond pattern where each line has increasing width of stars.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 23: Print a Diamond Pattern with Numbers Increasing**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a diamond pattern where numbers increase. Each row should show a symmetrical pattern with numbers increasing towards the center.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  1\n 121\n12321\n 121\n  1\n```\n\n---\n\n### **Problem 24: Print a Pattern of Increasing and Decreasing Stars**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern where stars increase to a midpoint and then decrease.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 25: Print a Matrix with Zigzag Pattern**\n**Difficulty:** Hard  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix with a zigzag pattern of numbers. The numbers should alternate direction row-wise.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1 2 3 4\n8 7 6 5\n9 10 11 12\n```\n\n---\n\n### **Problem 26: Print a Pattern of Alternating Characters in Rows**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern where rows alternate between two characters.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\nABAB\nBABA\nABAB\nBABA\n```\n\n---\n\n### **Problem 27: Print a Number Pyramid Pattern with Characters**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a pyramid pattern using increasing characters, where each row increases in width and character range.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  A\n BCD\nEFGHI\n```\n\n---\n\n### **Problem 28: Print a Pattern with Diagonal Lines**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with diagonal lines using characters. Each diagonal line should be aligned properly.\n\n**Example 1:**\n**Input:** `n = 4`  \n**Output:**\n```\nA\nB B\nC   C\nD     D\n```\n\n---\n\n### **Problem 29: Print a Matrix with Diamond Pattern of Numbers**\n**Difficulty:** Hard  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix where elements follow a diamond pattern with numbers.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  1\n 121\n12321\n 121\n  1\n```\n\n---\n\n### **Problem 30: Print a Cross Pattern of Stars with Diagonals**\n**Difficulty:** Hard  \n**Topics:** Pattern Printing  \n**Hint:** Print a cross pattern using stars with intersecting diagonals.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n* * * * *\n * * * *\n  * * *\n   * *\n    *\n   * *\n  * * *\n * * * *\n* * * * *\n```\n\n### **Problem 31: Print a Triangular Matrix with Numbers**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a triangular matrix where each row contains increasing numbers. Each subsequent row should start from the next number.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1\n2 3\n4 5 6\n```\n\n---\n\n### **Problem 32: Print a Star Pattern with Increasing and Decreasing Width**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with stars that increase to a midpoint and then decrease. The stars should be centered horizontally.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 33: Print a Pattern of Nested Squares**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with nested squares using stars. The outermost square should be filled with stars, and each subsequent square should be smaller and centered inside the previous one.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n*****\n*   *\n*   *\n*   *\n*****\n```\n\n---\n\n### **Problem 34: Print a Pattern with Increasing Characters in Columns**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern where each column contains increasing characters from `A`.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\nA\nB C\nD E F\n```\n\n---\n\n### **Problem 35: Print a Matrix with Spiral Diagonals**\n**Difficulty:** Hard  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix with numbers arranged in diagonal spirals. The numbers should fill the matrix in a diagonal spiral fashion.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1 2 3\n4 5 6\n7 8 9\n```\n\n---\n\n### **Problem 36: Print a Checkerboard Pattern with Increasing Size**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a checkerboard pattern where the size of each square increases as you move along the matrix.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\nXOX\nOXO\nXOX\n```\n\n---\n\n### **Problem 37: Print a Cross Pattern with Increasing Size**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a cross pattern where the size of the cross increases with each row. The pattern should be centered.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 38: Print a Pattern of Alternating Triangles**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with alternating triangles of stars. The triangles should alternate direction.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 39: Print a Matrix with Diamond Pattern of Numbers**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a matrix where numbers form a diamond pattern. The numbers should increase and decrease symmetrically around the center.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  1\n 121\n12321\n 121\n  1\n```\n\n---\n\n### **Problem 40: Print a Star Pattern with Increasing Width and Centered**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern where the width of stars increases, and the stars are centered horizontally.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n```\n\n---\n\n### **Problem 41: Print a Pattern with Spiral and Zigzag**\n**Difficulty:** Hard  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix with both spiral and zigzag patterns. The matrix should first fill in a spiral pattern and then in a zigzag fashion.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1 2 3\n6 5 4\n7 8 9\n```\n\n---\n\n### **Problem 42: Print a Pattern of Alternating Characters in Matrix**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a matrix where characters alternate in each cell to form a pattern.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\nABAB\nBABA\nABAB\n```\n\n---\n\n### **Problem 43: Print a Pattern with Nested Triangles**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with nested triangles of stars. Each triangle should be centered and decrease in size.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  *\n ***\n*****\n ***\n  *\n```\n\n---\n\n### **Problem 44: Print a Matrix with Increasing Rows and Columns**\n**Difficulty:** Easy  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix where each row and column contains increasing numbers.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n1 2 3\n4 5 6\n7 8 9\n```\n\n---\n\n### **Problem 45: Print a Pattern with Rows of Increasing Characters**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern where each row contains an increasing sequence of characters.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\nA\nBC\nDEF\n```\n\n---\n\n### **Problem 46: Print a Star Pattern with Diamond Shape and Numbers**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with a diamond shape of stars, with numbers inside the diamond.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n  1\n 121\n12321\n 121\n  1\n```\n\n---\n\n### **Problem 47: Print a Matrix with Cross Pattern of Numbers**\n**Difficulty:** Hard  \n**Topics:** Matrix Pattern  \n**Hint:** Print a matrix where the center forms a cross pattern with numbers.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n12321\n01210\n01210\n01210\n12321\n```\n\n---\n\n### **Problem 48: Print a Pattern with Concentric Squares**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with concentric squares using stars. The outer square should be larger and each subsequent square should be centered inside.\n\n**Example 1:**\n**Input:** `n = 5`  \n**Output:**\n```\n*****\n*   *\n*   *\n*   *\n*****\n```\n\n---\n\n### **Problem 49: Print a Pattern of Alternating Rows and Columns of Numbers**\n**Difficulty:** Easy  \n**Topics:** Pattern Printing  \n**Hint:** Print a pattern with alternating rows and columns of numbers, where each row and column increases sequentially.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n123\n456\n789\n```\n\n---\n\n### **Problem 50: Print a Matrix with Zigzag Pattern of Stars**\n**Difficulty:** Medium  \n**Topics:** Pattern Printing  \n**Hint:** Print a matrix where stars form a zigzag pattern, alternating rows in their positioning.\n\n**Example 1:**\n**Input:** `n = 3`  \n**Output:**\n```\n* * *\n * *\n* * *\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famreshpro%2Fpro150problems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famreshpro%2Fpro150problems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famreshpro%2Fpro150problems/lists"}