Given two integer arrays X and Y of size m and n, respectively, write a program to find the intersection of these two arrays. The intersection of two arrays is a list of distinct numbers which are present in both arrays. The numbers in the intersection can be in any order.
Given an array X of n integer elements, write a program to find the length of the longest subarray with a sum equal to 0. In general, for all j > i, find **max (j - i + 1)** among all subarray with zero-sum. Note: the length of a subarray starting from index i and ending at index j = j - i + 1.
This game is played in a group, where players take turns to say the next number in a sequence, counting one at a time. If the number is divisible by 3, the player must say, “Fizz” instead of the number itself. If the number is divisible by 5, the player must say, “Buzz”. If the number is divisible by both three and five, the player has to say, “Fizz buzz”. Given a number n, write a program that outputs the string representation of numbers from 1 to n.
Subscribe to get free weekly content on data structure and algorithms, machine learning, system design, oops and math.