Popular posts from this blog
Sum of largest and smallest element in array by tech mahindra 2022
Sum of the largest and smallest element in the array by tech Mahindra 2022.. .......................................................................................................................................................................... connect with me on Facebook Twitter Instagram Github Youtube ............................................................................................................................................ connect with me on Facebook Twitter Instagram Github Youtube
Given an array A, find the size of the smallest subarray asked in MountainBlue, 2022
Problem Statement : Given an array A, find the size of the smallest subarray such that it contains at least one occurrence of the maximum value of the array and at least one occurrence of the minimum value of the array. Problem Constraints 1<= |A| <= 2000 Input Format The first line is the number of elements in an array. The second line is the space-separated array elements. f.e: 123 4 means A= [1, 2, 3, 4] Output Format Return the lengtlh of the smallest subarray which has at léasi pne occurrence of minimum and maximum eleknenbot the array Example Input Input 1: LAG27A...........
Comments
Post a Comment