Atlassian | 27th September | Online Assessments | SDE | Project Assignment | Best Telescope Site | Merging Palindrimes

Atlassian · Question · Posted Oct 2022

Question 1 <problem>42</problem> A beautiful subarray is defined as an array of length having a specific number of odd elements. Given an array of integers and a number of odd elements that constitutes beauty, create as many distinct beautiful subarrays as possible. Distinct means the arrays don't share identical starting and ending indices, though they may share one of the two. For example, Given the array [1,2,3,4,5] and a beautiful number 2, the following beautiful subarrays can be formed. [1,2,3] ...

The full answer & interview discussion are available to premium members.

Log in Create a free account