Write test cases and the complexity for each code. Given an array of integers, find the closest value to the given number. The array may contain duplicate values and negative numbers. (Example : Array : 2,5,8,8,9,6,7,3 Target number : 5 Output : 5)(Target number : 11 Output : 9)(Target Number : 4 Output : 5)
Aucun commentaire:
Enregistrer un commentaire