Question: java program Coding Sample 9 WhatsApp New Tab. Secure https://codingworksample.io/c/run/UREUD3-SMG Your task is to find the latest day on which there is some blossoming group



java program
Coding Sample 9 WhatsApp New Tab. Secure https://codingworksample.io/c/run/UREUD3-SMG Your task is to find the latest day on which there is some blossoming group of size K. Write a function: class solution { public int solution (int[] P, int K); } that, given a zero-indexed array P.containing N integers (a permutation of numbers from 1 to N), where P[] denotes the number of the rose which will start blooming on day number 1+1, and integer K, returns the latest day on which there is some blossoming group of size K. If there is no such day, the function should return -1. For example, given P = [3, 1, 5, 4, 2) (means the 3rd rose blooms on Day 1, the 1st rose blooms on Day 2, the 5th rose blooms on Day 3, the 4th rose blooms on Day 4 and the 2nd rose blooms on Day 5) and K=1 your function should return 4. Given the same array P but a value of K = 2, your function should return -1. Day 1 IR 11 I One group (3.3|| Custom test cases 0/10 I IMG 78 - amazing Spiderm.mp3A Document (2).pdf | 0 0 - 9 S, E O O Coding Sample 9 WhatsApp New Tab. Secure https://codingworksample.io/c/run/UREUD3-SMG Your task is to find the latest day on which there is some blossoming group of size K. Write a function: class solution { public int solution (int[] P, int K); } that, given a zero-indexed array P.containing N integers (a permutation of numbers from 1 to N), where P[] denotes the number of the rose which will start blooming on day number 1+1, and integer K, returns the latest day on which there is some blossoming group of size K. If there is no such day, the function should return -1. For example, given P = [3, 1, 5, 4, 2) (means the 3rd rose blooms on Day 1, the 1st rose blooms on Day 2, the 5th rose blooms on Day 3, the 4th rose blooms on Day 4 and the 2nd rose blooms on Day 5) and K=1 your function should return 4. Given the same array P but a value of K = 2, your function should return -1. Day 1 IR 11 I One group (3.3|| Custom test cases 0/10 I IMG 78 - amazing Spiderm.mp3A Document (2).pdf | 0 0 - 9 S, E O O
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
