You are working in the Data Consistency team of your company. You are allocated a task as follows:
You are given the following:
Task
Determine the maximum number of separations that can be made in the array by spending no more than K coins.
Example
Assumptions
Approach
Function description
Complete the function Decryptions() which takes an integer N and an array Arr. This function takes the following parameters and returns the required answer:
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
Output format
Print the maximum number of separations that can be made in the array by spending no more than K coins.
Constraints
2≤N≤100
1≤K≤100
1≤arri≤100
Code snippets (also called starter code/boilerplate code)
This question has code snippets for C, CPP, Java, and Python.
It is not possible to make even one cut even with an unlimited number of coins as the condition for valid separation can not be fulfilled in any separation.