Phase 4b (Problem Solving) ii. Given an array of integers, find the longest subarray where the absolute difference between any two elements is less than or equal to 1. Example There are two subarrays meeting the criterion: and . The maximum length subarray has elements. Function Description Complete the pickingNumbers function in the editor below. pickingNumbers has the following parameter(s): int a[n]: an array of integers Returns int: the length of the longest subarray that meets the criterion Input Format A = [1,1,2,2,4,4,5,5,5] The first line contains a single integer , the size of the array . The second line contains space-separated integers, each an . Ans: [4,4,5,5,5] Constraints 2<=n<=100 0< a[i]<100 The answer will be >=2 6 4 6 5 3 3 1 Answer: 3 {4,3,3} 6 1 2 2 3 1 2 Answer: 5 {1,2,2,1,2}
Backend Engineer Interview Questions
15,481 backend engineer interview questions shared by candidates
What is API? How API works? Write code for the API?
Te interesaría aprender sobre otras tecnologías o ser full stack?
Find the middle element of the linked list.
Try catch block, you open a connection to DB, where do you close it?
What is your name and location?
SQL query to fetch all emails who have @test.com in upper and lower both cases .
what are my technical skills
Find the number of duplicate letters in a string entry
What do you think of the games?
Viewing 1031 - 1040 interview questions