DSA: Arrays

For interviews


Progress
Reviewed: 0%
8 Tasks


The array tracker covers the fundamentals of arrays, a data structure used to store and access multiple elements under a single name. Topics include array creation, accessing elements, modifying array values, array traversal, and common array algorithms. Students will learn to efficiently manipulate and work with arrays to solve programming problems effectively.

Begin by creating a GitHub account.
1. Once you have your account, create a new repository with the name "skill_captain_dsa_arrays ".
2. Inside this repository, organize your daily assignments by creating a separate folder for each day's work. Name each folder "day".
3. Make sure to add your assignments to the respective day's folder to keep them organized and easily accessible.
By following these steps, you'll have a GitHub account with a repository specifically designed for your DSA:Arrays assignments, neatly organized by day.


  • Day 1
  • 1-D Array

    Concept:



    Resources:



    Assignments:


    Given a string s, reverse only all the vowels in the string and return it.
    The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.

    Example 1:

    Input: s = "hello"
    Output: "holle"



  • Day 2
  • 1-D Array Continued...

    Concept:



    Resources:



    Assignments:


    Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
    You must write an algorithm that runs in O(n) time and without using the division operation.

    Example 1:

    Input: nums = [1,2,3,4] Output: [24,12,8,6]



  • Day 3
  • Some more concept on 1-D Array

    Concept:



    Resources:



    Assignments:


    Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
    Notice that the solution set must not contain duplicate triplets.

    Example 1:
    Input: nums = [-1,0,1,2,-1,-4]
    Output: [[-1,-1,2],[-1,0,1]]
    Explanation:
    nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0.
    nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.
    nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.

    The distinct triplets are [-1,0,1] and [-1,-1,2].
    Notice that the order of the output and the order of the triplets does not matter.



  • Day 6
  • Elimination game (Without Recursion)

    Concept:



    Resources:



    Assignments:


    You have a list arr of all integers in the range [1, n] sorted in a strictly increasing order. Apply the following algorithm on arr:

    1. Starting from left to right, remove the first number and every other number afterward until you reach the end of the list.
    2. Repeat the previous step again, but this time from right to left, remove the rightmost number and every other number from the remaining numbers.
    3. Keep repeating the steps again, alternating left to right and right to left, until a single number remains.

    Given the integer n, return the last number that remains in arr.

    Example:
    Input: n = 9
    Output: 6
    Explanation:
    arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    arr = [2, 4, 6, 8]
    arr = [2, 6]
    arr = [6]



  • Day 7
  • H - Index

    Concept:



    Resources:



    Assignments:


    Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index.

    The h-index is defined as the maximum value of h such that the given researcher has published at least h papers that have each been cited at least h times.

    Example 1:
    Input: citations = [3,0,6,1,5]
    Output: 3
    Explanation: [3,0,6,1,5] means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively.
    Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.



×

Let's Go!

Congratulations on getting started. Here is a little reward for you...

×

10

Going to the next task in