InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 20501. |
Given the importance of registers, what is the rate of increase in the number of registers in a chip over time |
|
Answer» 100*30*50*40*20+1111¹111114114589/6/6'8""8/6'6"5:8?8!6"6$6$5::8?8?9!9!*!'6"5:5:8?!,*'6'"5""5?9!9!9!6$"5::8:8?0?!9!,'6$5(5:5"''*'*"+$5$5"?8!9!6'$5$5"8?8!9'*'*'6$5"6"'[email protected]*@*'*!*? |
|
| 20502. |
Given two strings, write a method to decide if one is a permutation of theother |
|
Answer» pls mark as BRAINLIEST friendExplanation:Check if two strings are PERMUTATION of each otherWrite a function to check whether two given strings are Permutation of each other or not. A Permutation of a string is another string that contains same CHARACTERS, only the order of characters can be different. For EXAMPLE, “abcd” and “dabc” are Permutation of each other.We strongly recommend that you click here and practice it, before moving on to the solution.Method 1 (Use Sorting)1) Sort both strings2) COMPARE the sorted string |
|
| 20503. |
Given two strings string1 and string2, find the smallest substring in string1 containing all characters of string2 efficiently. |
| Answer» LENGTH of STRING1 * length of string2Explanation: DYNAMIC PROGRAMMING O(m*N) | |
| 20504. |
Given two strings, determine if they share a common substring. A substring may be as small as one character.For example, the words "a", "and", "art" share the common substring. The words "be" and "cat" do not share a substring. |
|
Answer» son for the timeout is probably: to compare two strings that each are 1.000.000 characters long, your CODE needs 1.000.000 * 1.000.000 comparisons, always.There is a faster algorithm that only needs 2 * 1.000.000 comparisons. You should use the faster algorithm INSTEAD. Its basic idea is:for each character in s1: add the character to a set (this is the first million)for each character in S2: test whether the set from step 1 contains the character, and if so, RETURN "yes" immediately (this is the second million)Java already provides a BitSet DATA type that does all you need. It is used like this:Bit Set seen In S1 = new Bit Set();seen In S1. set('x');seen InS1. get('x');please mark it as a brainlist please plz |
|
| 20505. |
Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array in c |
|
Answer» ejebbdhekw SHD) jobhwwsid |
|
| 20506. |
Given the input parameters, simulation variable, output statistics for the queueing system. Calculate the output statistics for the queueing system whose inter-arrival and service times for ten arrivals are given below |
|
Answer» ival timeIAT: Interarrival timeST: Service Timeo/p statisticsAvg waiting TIME for a customer = 910=0.9910=0.9Probability of IDLE server = 1853=0.341853=0.34Probability customer has to wait = 310=0.3310=0.3Avg service time = 3510=3.53510=3.5Avg time between arrival = 469=5.11469=5.11Avg waiting time for customer who waits = 93=393=3Avg time customer spent in the system = 4410=4.44410=4.4Max queue length = 1please mark it as a brainlist please PLZ plz |
|
| 20507. |
Given a sorted array of integers, what can be the minimum worst case time complexity to find ceiling of a number x in given array? Ceiling of an element x is the smallest element present in array which is greater than or equal to x. Ceiling is not present if x is greater than the maximum element present in array. For example, if the given array is {12, 67, 90, 100, 300, 399} and x = 95, then output should be 100. |
|
Answer» Given a sorted array of integers, what can be the minimum worst case time complexity to find ceiling of a number x in given array? Ceiling of an element x is the smallest element present in array which is greater than or equal to x. Ceiling is not present if x is greater than the maximum element present in array. For example, if the given array is {12, 67, 90, 100, 300, 399} and x = 95, then output should be 100.(A) O(LogLogn)(B) O(n)(C) O(Logn)(D) O(Logn * Logn)Explanation:We modify standard binary search to find ceiling. The time complexity T(n) can be written asT(n) <= T(n/2) + O(1)Solution of above recurrence can be obtained by Master Method. It falls in case 2 of Master Method. Solution is O(Logn).#include |
|
| 20508. |
Given memory partitions of 100 k, 500 k, 200 k, 300 k and 600 k (in order) and processes of 212 k, 417 k, 112 k, and 426 k (in order), using the first-fit algorithm, in which partition would the process requiring 426 k be placed ? |
| Answer» THANKS for the POINTS. | |
| 20509. |
Given a sorted array, remove the duplicates in place such that each element can appear atmost twice and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. |
|
Answer» R GolangKotlinJavaSpring BootNode.jsSystem DesignDevOpsAlgorithmsAboutRemove duplicates from SORTED array IIAlgorithms • Nov 3, 2019 • 2 mins readRemove Duplicates from Sorted Array IIGiven a sorted array, remove the duplicates from the array in-place such that each element appears at most twice, and return the new length.Do not allocate extra space for another array, you must do this by MODIFYING the input array in-place with O(1) extra memory.ExampleGiven array [1, 1, 1, 3, 5, 5, 7]The output should be 6, with the first six elements of the array being [1, 1, 3, 5, 5, 7]Remove Duplicates from Sorted Array II solution in JavaThis problem is an extension of the problem Remove duplicates from Sorted ArrayIt can also be solved in O(n) time complexity by using two pointers (indexes).class RemoveDuplicatesSortedArrayII { private static int removeDuplicates(int[] nums) { int n = nums.length; /* * This INDEX will move when we modify the array in-place to include an element * so that it is not repeated more than twice. */ int j = 0; for (int i = 0; i < n; i++) { /* * If the current element is EQUAL to the element at index i+2, then skip the * current element because it is repeated more than twice. */ if (i < n - 2 && nums[i] == nums[i + 2]) { continue; } nums[j++] = nums[i]; } return j; } public static void main(String[] args) { int[] nums = new int[] { 1, 1, 1, 3, 5, 5, 7 }; int newLength = removeDuplicates(nums); System.out.println("Length of array after removing duplicates = " + newLength); System.out.print("Array = "); for (int i = 0; i < newLength; i++) { System.out.print(nums[i] + " "); } System.out.println(); }} |
|
| 20510. |
Given a sorted matrix where the number below and right of you will always be bigger, write an algorithm to find if a particular number exist in the matrix. What is the running time of your algorithm\ |
|
Answer» Given a sorted MATRIX mat[N][m] and an element ‘x’. Find POSITION of x in the matrix if it is present, else print -1. Matrix is sorted in a way such that all elements in a row are sorted in increasing order and for row ‘i’, where 1 INPUT : mat[][] = { {1, 5, 9}, {14, 20, 21}, {30, 34, 43} } x = 14 Output : Found at (1, 0) Input : mat[][] = { {1, 5, 9, 11}, {14, 20, 21, 26}, {30, 34, 43, 50} } x = 42 Output : -1.. |
|
| 20511. |
Given a positive integer, return its corresponding column title as appear in an excel sheet. |
|
Answer» MS Excel columns has a pattern like A, B, C, … ,Z, AA, AB, AC,…. ,AZ, BA, BB, … ZZ, AAA, AAB ….. ETC. In other words, COLUMN 1 is named as “A”, column 2 as “B”, column 27 as “AA”.Given a column number, find its corresponding Excel column name. Following are more examples.Input Output 26 Z 51 AY 52 AZ 80 CB 676 YZ 702 ZZ 705 AAC.. |
|
| 20514. |
Given an unsorted array of size n.Ind the 1st element in array.Such that all of its elemets are smaller and all right element to it greater than it |
| Answer» | |
| 20515. |
Given an unsorted array of n elements find if the element k is present in the array or not javascript |
|
Answer» n unsorted array of n elements, find if the element k is present in the array or not.Complete the findNumber function in the editor below. It has 2 PARAMETERS:An array of integers, arr, denoting the elements in the array.An integer, k, denoting the element to be searched in the array.The function must return a string “YES” or “NO” denoting if the element is present in the array or not.I have seen this type of problem before in a lecture. It is most efficient to use a binary search algorithm after sorting the array.Binary search works like so: A sorted array is like a phone book. I want to look up the number for something like “Gary’s Guitar Lessons.” I flip to the MIDDLE, and the page has the number for “Ma and Pa’s Diner.” I throw out the bottom half because “Gary’s” would be in between the beginning and the middle. Then, I would repeat the process of (1) going to the middle and checking, (2) throwing out a half, and (3) checking the middle of the other half. Eventually, I will find it or determine it’s missing from the phone book.Binary search is better than linear search in terms of time COMPLEXITY because the amount of data gone through goes down by a half, as OPPOSED to 1 item LESS. (assuming both are given a sorted array as an argument)I implemented a binary search quickly based on my pseudocode knowledge… |
|
| 20516. |
Given an unsorted array a of size n of non-negative integers, find a continuous sub-array which adds to a given number s. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung TSANGPO River (UPPER STREAM of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (ARUNACHAL Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20517. |
Given a number less than 9999 -can you write a func(on that outputs this in words javascript |
| Answer» | |
| 20518. |
Given a number, write a c program using while loop to reverse the digits of the number. |
|
Answer» #include |
|
| 20519. |
Given an iterator with methods next() and hasnext(), create a wrapper iterator, peekableinterface, which also implements peek(). Peek shows the next element that would be returned on next(). |
| Answer» THANKS for the POINTS . | |
| 20520. |
Given an integer array (of length n), find and return all the subsets of input array. Subsets are of length varying from 0 to n, that contain elements of the array. But the order of elements should remain same as in the input array. Note : the order of subsets are not important. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the PLAINS of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the EURASIAN Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, NANGA Parbat, lies just south of the northernmost bend of Indus RIVER. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic VALLEY called the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (ArunPradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20521. |
Given an unsorted array arr[] of n integers and a sum. The task is to count the number of subarray which adds to a given number. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range RUNS west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic VALLEY called the Indus-Tsangpo Suture. TOWARDS the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20522. |
Given an array which is first strictly increasing and then strictly decreasing. Find an element in this array. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, MOUNT Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (ACONCAGUA, in the ANDES) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley CALLED the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (mi) in the east (Arunachal Pradesh). The Himalayas are distinct frthe other great ranges of central Asia, although somet the term 'Himalaya' (or 'Greater Himalaya') is LOOSELY used to include the Karakoram and some of the other ranges. |
|
| 20523. |
Given an array s of n integers, are there elements a, b, c, and d in s such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian SUBCONTINENT from the Tibetan Plateau. The range has many of the Earth's highest PEAKS, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, NANGA Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated fllllll the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Tsangpo SUTURE. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are DISTINCT from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20524. |
Given an array of strings, return all groups of strings that are anagrams. Represent a group by a list of integers representing the index in the original list. Look at the sample case for clarification. |
|
Answer» A inner loop checks whether remaining strings are anagram of the STRING PICKED by outer loop. Below is the implementation of ... |
|
| 20525. |
Given an integer array of size 2n + 1. In this given array, n numbers are present twice and one number is present only once in the array. You need to find and return that number which is unique in the array. |
|
Answer» ififkfjfjdjckvkgkfjdhmmfmg |
|
| 20526. |
Given an array of real numbers greater than zero in form of strings. Find if there exists a triplet (a,b,c) such that 1 < a+b+c < 2 . Return 1 for true or 0 for false. |
| Answer» SORRY I don't know this answerExplanation:PLEASE MARK me as a BRAIN list | |
| 20527. |
Given an array where elements are sorted in ascending order, convert it to a height balanced bst |
|
Answer» /gist.github.com/soundsilence/4673024. you can GET your ANSWER |
|
| 20528. |
Given an array of size n-1 and given that there are numbers from 1 to n with 1 missing number find the missing element in c language |
|
Answer» fhmkc fhykur,tkufktukExplanation: |
|
| 20529. |
Given an array of positive integers. Your task is to find the leaders in the array. Note: an element of array is leader if it is greater than or equal to all the elements to its right side. Also, the rightmost element is always a leader. |
|
Answer» The HIMALAYAS, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, MOUNT Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its EASTERN anchor, Namcha Barwa, is just west of bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is BORDERED on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (PAKISTAN) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20530. |
Given an array of number find the number which is largest in the array |
|
Answer» cjcjdjfjdjfkfjfmdjgjfj |
|
| 20531. |
Given an array of length n, you need to find and return the sum of all elements of the array. |
|
Answer» gjcifkckclcjxjGMvjxlHDuGMb |
|
| 20532. |
Given an array of 2n elements of which n elements are same and the remaining n elements are all different. Write a c program to find out the value which is present n times in the array. There is no restriction on the elements in the array. They are random (in particular they not sequential). |
|
Answer» zgizizkgzkgsgikkgzkxkgi |
|
| 20533. |
An IP packet arrives at a router with the first eight bits as 01001000. How many bytes are there in the OPTIONS field? |
| Answer» WELL,EXPLANATION:In this I.P packet 72 bytes are there.But there is no OPTION given. | |
| 20534. |
Write a short note on CPU |
|
Answer» ☛ CPU is the part of the computer that CARRIES out the instructions of a computer program .☛ It is the unit that reads and EXECUTES program instructions . Hence it is known as the BRAIN of the computer .☛ It takes all major decisions makes all sorts of calculations and direct different parts of the computer function by activating and controlling the operation .☛ The CPU controls and coordinates all the actions of the entire system .☛ The CPU consists of storage or Memory unit (MU) Arithmetic logic unit (ALU) and Control unit ( CU). |
|
| 20535. |
Which function is used to calculate the sum of table value |
| Answer» | |
| 20536. |
given an array of integers, sort the array according to frequency of elements. For example, if the input array is {2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12}, then modify the array to {3, 3, 3, 3, 2, 2, 2, 12, 12, 4, 5}. |
| Answer» TION:dufudjfndjdjdudjfhxjdj | |
| 20537. |
Given an array of length n and an integer x, you need to find and return the first index of integer x present in the array. Return -1 if it is not present in the array. First index means, the index of first occurrence of x in the input array. |
|
Answer» ifkfjdhdgjdjfkfkgkfkgkf |
|
| 20538. |
Given an array of integers a. Create one more array b and fill each element with the height frequent element(o to ith position in the array.) |
|
Answer» nskhdhskjdbzjhzhdnsfifogj |
|
| 20539. |
Given an array of integers. Write a program to find the k-th largest sum of contiguous subarray within the array of numbers which has negative and positive numbers. |
|
Answer» tion:excel is an APPLICATION for the K- the largest NUMBERS which has NEGATIVE and positive numbers |
|
| 20540. |
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6]. Follow-up: what if you can't use division? |
|
Answer» dhjt6jfhykktktyukExplanation: |
|
| 20541. |
Given an array of integers(pos/neg) in sorted order, return an array of elements square in sorted order. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-NORTHWEST to east-southeast in an arc 2,400 km (1,500 mi) long. Its western ANCHOR, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung TSANGPO River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush RANGES. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Tsangpo SUTURE. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20542. |
Given an array of integers a and an integer b, find and return the number of pairs in a whoes sum is divisible by b. Since the answer may be large, return the answer modulo (10^9 + 7). Input format |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian SUBCONTINENT from the Tibetan PLATEAU. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic PLATE under the Eurasian Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the NORTHERNMOST bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50– (31–37 mi) wide tectonic valley called the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic PLAIN. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20543. |
Given an array find two numbers that equal the product of x |
| Answer» L am not UNDERSTAND your QUESTION | |
| 20544. |
Given an array containing n elements. The task is to find maximum number of distinct elements after removing k elements from the array. |
| Answer» TION:pfodkdlfkckckdiydiyfpucjfhliix* | |
| 20545. |
Given an array int marks[ ]={99,76,87,65,88,90,43,58}. Calculate the address of marks[5] if base address is 1009. C |
|
Answer» #include |
|
| 20546. |
Given an array a of n positive integers. Find the minimum number of operations (change a number to greater or lesser than original number) in array so that array is strictly increasing (a[i] < a[i+1]). |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains EXCEEDING 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic PLATE under the Eurasian Plate, the HIMALAYAN mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western ANCHOR, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Tsangpo . Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in WIDTH from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20547. |
Given an array a of n elements. Find the majority element in the array. A majority element in an array a of size n is an element that appears more than n/2 times in the array. |
| Answer» TION:WAIT for SECOND I am SOLVING QUESTIONS | |
| 20548. |
Given an array and an integer 'k', find the maximum, for each and every contiguous subarray of size 'k' leetcode |
|
Answer» The Himalayas, or HIMALAYA is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the SUBDUCTION of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to EAST-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the HINDU Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide t valley called the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although SOMETIMES the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20549. |
Given an array arr[] of size n containing 0s and 1s only. The task is to count the subarrays having equal number of 0s and 1s. |
|
Answer» The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to EAST-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga PARBAT, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha BARWA, is just west of the great bend of the Yarlung TSANGPO River (upper stream of the Brahmaputra River). The Himalayan range is bordered on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the cha separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of CENTRAL Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges. |
|
| 20550. |
Given an array and a number (say s), find whether any two elements in the array whose sum is s. |
| Answer» TION:ifigifjcjfjfudjfhfjefifkfjdHDhdjdjfjxj | |