Company: Amazon_29may
Difficulty: medium
Well-Organized Course Structures body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; } pre { background-color: #f4f4f4; padding: 10px; border: 1px solid #ddd; overflow-x: auto; } .important { font-weight: bold; } Well-Organized Course Structures Problem Statement The Department of Mathematics has n courses, where the difficulty of the i th course is represented by the array difficulty[i] . A course structure can be created in the following way: A non-empty subarray of courses is chosen from the given array of courses. The chosen subarray of courses is removed from the original array of courses. A course structure is defined to be well-organized if the array of courses in the course structure is non-empty and is sorted in increasing order of difficulty (i.e., each element is greater than or equal to the previous element). Given n courses and an array difficulty , find the number of well-organized course structures that can be created with the given array of courses. N