Microsoft OA Arithmetic Slices Solution

Microsoft Online Assessment 2021 Questions and Solution

Microsoft OA Arithmetic Slices Solution An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, [1,3,5,7,9], [7,7,7,7], and [3,-1,-5,-9] are arithmetic sequences. Given an integer array nums, return the number of arithmetic subarrays of nums. A subarray is a contiguous subsequence of the array. Also See: Microsoft Online Assessment Questions … Read more

Microsoft OA Particle Velocity Solution

Microsoft Online Assessment 2021 Questions and Solution

Microsoft OA Particle Velocity Solution You are a programmer in a scientific team doing research into particles. As an experiment, you have measured the position of a single particle in N equally distributed moments of time. The measurement made in moment K is recorded in an array particles as particles[K]. Now, your job is to count all the periods of time when … Read more

Microsoft OA Unique Integers That Sum Up To 0

Microsoft Online Assessment 2021 Questions and Solution

For “Unique Integers That Sum Up To 0” and “Find N Unique Integers Sum up to Zero” problem we have two different set of input and output so please be careful while reading through the article, this questions were also asked in Microsoft Online Assessment. Make sure you scroll till the end to see both … Read more

Maximum Length of a Concatenated String with Unique Characters

Microsoft Online Assessment 2021 Questions and Solution

Microsoft Online Assessment Maximum Length of a Concatenated String Length with unique Characters Given an array of strings arr. String s is a concatenation of a sub-sequence of arr which have unique characters. Return the maximum possible length of s. Also See: Microsoft Online Assessment Questions and Solution Example 1: Input: arr = [“un”,”iq”,”ue”] Output: 4 Explanation: All possible concatenations are … Read more

Microsoft OA Min Adj Swaps to Group Red Balls

Microsoft Online Assessment 2021 Questions and Solution

Microsoft OA Min Adj Swaps to Group Red Balls | Minimum number of swaps in constant time Min Adj Swaps to Group Red Balls There are N balls positioned in a row. Each of them is either red or white . In one move we can swap two adjacent balls. We want to arrange all the red balls into a consistent … Read more