Counting Beautiful Subarrays
You are given an array nums consisting of positive integers.
A subarray of an array is considered beautiful if the number of distinct elements in the subarray is equal to the number of distinct elements in the whole array.
Your task is to find and print the number of beautiful subarrays in the given array.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)