Company: Amazon_29may
Difficulty: medium
Well-Organized Course Structures body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; } h1 { color: #333; } h2 { color: #444; } p { margin-bottom: 10px; } pre { background-color: #f4f4f4; padding: 10px; border: 1px solid #ddd; overflow-x: auto; } code { font-family: 'Courier New', monospace; } .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. Given n courses, and an array difficulty , find the number of well-organized course structures that can