Hide Kata Description
Description: You get an array of arrays. If you sort the arrays by their length, you will see, that their length-values are consecutive. But one array is missing! You have to write a method, that return the length of the missing array. Example: [[1, 2], [4, 5, 1, 1], [1], [5, 6, 7, 8, 9]] --> 3 If the array of arrays is null/nil or empty, the method should return 0. When an array in the array is..
2022. 4. 5.
Array.diff
문제 설명 Your goal in this kata is to implement a difference function, which subtracts one list from another and returns the result. It should remove all values from list a, which are present in list b keeping their order. array_diff([1,2],[1]) == [2] If a value is present in b, all of its occurrences must be removed from the other: array_diff([1,2,2,2,3],[2]) == [1,3] 해결 방법 1. b리스트 안의 요소가 a리스트 안에 ..
2022. 2. 13.