Assignment 01
Assignment 01
Course Title: Data Structure & Algorithm Lab II Course Code: CSE 2218
Trimester & Year: Fall 2023 Section: D Credit Hours: 1.0 (MdMH)
Example 1:
Output: 6
Example 2:
Output: 1
Example 3:
Output: 23
Constraints:
Given a set of integers, Alif needs to find out the total number of such violations.
Input:
Example:
Note that it is the kth largest element in the sorted order, not the kth distinct element.
Example 1:
Output: 5
Example 2:
Output: 4
Constraints:
A reverse pair is a pair (i, j) where 0 <= i < j < nums.length and nums[i] >
2 * nums[j].
Example 1:
Output: 2
Example 2:
Output: 3
Constraints: