1. Asteroid Collision Problem Description Given an array/list ASTEROIDS representing asteroids aligned in a row, each element's absolute value identifies the asteroid's size, while its sign indicates the direction (+ve means moving right, -ve means moving left). An asteroid with a value of 0 is massless and moves to the right. Your task is to determine the state of the asteroids after all possible collisions have occurred. Example: Input: ASTEROIDS = {3, -2, 4} Output: {3, 4} Explanation: The first asteroid will destroy the second asteroid. Thus, the remaining asteroids are {3, 4}. Constraints: 1 <= T <= 50 1 <= N <= 10^4 -10^5 <= ASTEROIDS[i] <= 10^5 Where ASTEROIDS[i] denotes the i-th asteroid. Time Limit: 1 sec Input: The first line contains an integer ‘T’ for the number of test cases.The second line of each test case contains an integer ‘N’ for the number of elements.The third line contains ‘N’ space-separated integers denoting the array ASTEROIDS. Output: For each test case, print all remaining asteroids separated by a space. Note: Implementation is needed for the collision logic; printing is handled elsewhere.
2. Container with Most Water Problem Statement Given a sequence of 'N' space-separated non-negative integers A[1], A[2], ..., A[i], ..., A[n], where each number in the sequence represents the height of a line drawn at point 'i'. On the Cartesian plane, each line is drawn from coordinate ('i', 0) to coordinate ('i', 'A[i]'). The task is to find two lines such that, together with the x-axis, they form a container that can hold the maximum area of water. Input: The first line of input contains an integer 'T' representing the number of test cases.The next '2*T' lines represent the 'T' test cases.The first line of each test case contains the number of elements in the sequence.The second line of each test case contains 'n' space-separated integers which is the given sequence. Output: For each test case, return the area of the container that can hold the maximum amount of water using any pair of lines from the given sequence. Example: Explanation: In the provided diagram example, suppose the first red marked line is formed between coordinates (2,0) and (2,10), and the second red marked line is formed between coordinates (5,0) and (5,9). The area of water contained is calculated as (height * width) = (5-2) * 9 = 27, which is the maximum area that can be contained between any two lines on the plane. Therefore, the function should return 3* 9 = 27 in this scenario. Constraints: 1 <= T <= 50 0 <= N <= 10^4 1 <= A[i] <= 10^5 Time Limit: 1 second Note: 1. You cannot slant the container; the height of the water is equal to the minimum height of the two lines that form the container.2. Do not print anything; simply return the maximum water area the container can hold.
3. Arithmetic Subarrays Problem Statement You are provided with an array A of length N. Your task is to determine the number of arithmetic subarrays present within the array A. Explanation: An arithmetic subarray is defined as a subarray that contains 3 or more elements, where the difference between consecutive elements remains consistent. For example, [1, 3, 5, 7] is an arithmetic subarray with a length of 4, and the difference between any two consecutive elements is 2. Note: A subarray is a sequence extracted from a contiguous segment of an array and maintains the order of elements. Input: The first line contains the integer T representing the number of test cases.Each test case consists of two lines:1. The first line includes the integer N, representing the length of the array.2. The second line contains N space-separated integers representing the elements of the array A. Output: Return the number of arithmetic subarrays found for each test case. Example: Input: 241 3 5 751 2 4 6 8 Output: 32 Constraints: 1 ≤ T ≤ 100 1 ≤ N ≤ 3000 0 ≤ A[i] ≤ 5000 Time Limit: 1 second Note: Ensure your implementation only returns results, as output is already managed.
4. Overall supply needed for N number of tasks
5. What was your last CTC, and what are your salary expectations for this role?
Browse through a variety of job opportunities tailored to your skills and preferences. Filter by location, experience, salary, and more to find your perfect fit.
We have sent an OTP to your contact. Please enter it below to verify.