Minimum Split Cost with Importance Value
You are given an integer array nums and an integer k. Your task is to divide the array into several non-empty subarrays. The cost of a split is calculated as the sum of the importance value of each subarray in the split.
The importance value of a subarray is defined as k plus the length of the subarray after removing elements that appear only once.
Your goal is to minimize the total cost of splitting the array.
Print the minimum possible cost of splitting nums into subarrays.
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)