Given a set of distinct positive integers, find the largest subset such that every pair ( Si, Sj ) of elements in this subset satisfies:Si…
Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j…
Multiple Queries using array numsGiven an integer array nums, handle multiple queries of the following types:Update the value of an element in nums.Calculate the sum…
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG”. When studying DNA, it is sometimes…
Given binary array, find count of maximum number of consecutive 1’s present in the array. Input_1:arr[ ] : 1 1 0 0 1 0 1…
You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores…
Given an integer num, return a string of its base 7 representation. Input_1:Give an integer number : 100 Output:202 Input_2:Give an integer number : -7…
Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element…
Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]…. Input_1:Array_nums : 20 10 8 6 4 2Output:[2, 10, 6, 8, 4,…
Repeating ElementsGiven an array nums containing n + 1 integers where each integer is between 1 and n (inclusive) Input_1:Elements : 8 8 7 5…
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is…
Given a non-empty array of numbers, a0, a1, a2 ….. where 0 ≤ ai < 2^31. Find the maximum result of ai XOR aj, where 0 ≤ i, j < n. Could you…
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may…
Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Input_1:Enter a list of arrays…
8=2+2+2+2= multiplying gives = 16highest factor in addition. 4= 2+2 = multiply = 4 9 = 3+3+3 = multiply = 27its greater common factor Input_1:Enter…
A chocolate factory is packing chocolates into the packets. The chocolate packets here represent an array arrt of N number of integer values. The task…
Given a non-empty array of integers, every element appears twice except for one. Find that single one. Input_1:Enter the array elements : 1 2 3…
Find the duplicate letters in string. Same to do in dictionary way. Input_1:Enter a String : fcukthecodeOutput:fcuktheod Input_2:Enter a String : programmingOutput:programin Input_3:Enter a String…
Given two strings str1 and str2 and below operations that can performed on str1. Find minimum number of edits (operations) required to convert ‘str1’ into…
Given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit(6…