Company: NAB_12dec
Difficulty: medium
Array Value and Frequency Check Problem Description You are given a task to fix a buggy function. The function solution takes a zero-indexed array of integers values , and two integers K and L . The function should return true if both of the following conditions are met, and false otherwise: The last element of the array values must be equal to K . No number in the array values can appear more than L times. Task The attached code is an incorrect implementation for this problem and fails for some inputs. The goal of the exercise is to find and fix the bug(s) in the implementation. You can modify at most three lines of the provided code. Examples Example 1: Given values = [1, 1, 4, 4] , K = 4 , and L = 2 , the function should return true . Explanation: The last element is 4, which equals K. The numbers 1 and 4 both appear twice, which is not more than L (2). Example 2: Given values = [1, 1, 2, 4] , K = 4 , and L = 1 , the function should return false . Explanation: Number 1 appears in th