Leetcode 1213. Intersection of Three Sorted Arrays

Posted on Fri 22 November 2024 in Leetcode Premium • Tagged with pointers

Question Link : https://leetcode.com/problems/intersection-of-three-sorted-arrays/

Difficulty: Easy

Premium: True

Question

Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays.   Example 1:

Input: arr1 = [1,2,3,4,5], arr2 = [1 …


Continue reading

Leetcode 0088. Merge Sorted Array

Posted on Mon 02 September 2024 in Leetcode • Tagged with pointers

Question Link : https://leetcode.com/problems/merge-sorted-array/

Difficulty: Easy

Premium: False

Question

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single array sorted …


Continue reading

Leetcode 1768. Merge Strings Alternately

Posted on Mon 17 April 2023 in Leetcode • Tagged with pointers

Question Link : https://leetcode.com/problems/merge-strings-alternately/

Difficulty: Easy

Premium: False

Question

You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged …


Continue reading

Leetcode 2414. Length of the Longest Alphabetical Continuous Substring

Posted on Thu 10 November 2022 in Leetcode • Tagged with pointers, stack

Question Link : https://leetcode.com/problems/length-of-the-longest-alphabetical-continuous-substring/

Difficulty: Medium

Question

An alphabetical continuous string is a string consisting of consecutive letters in the alphabet. In other words, it is any substring of the string "abcdefghijklmnopqrstuvwxyz".

For example, "abc" is an alphabetical continuous string, while "acb" and "za" are not.

Given …


Continue reading

Leetcode 1578. Minimum Time to Make Rope Colorful

Posted on Mon 03 October 2022 in Leetcode • Tagged with pointers, array

Question Link : https://leetcode.com/problems/minimum-time-to-make-rope-colorful/

Difficulty: Medium

Question

Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon. Alice wants the rope to be colorful. She does not want two consecutive balloons to …


Continue reading