Question In the popular Minesweeper game you have a board with some mines and those cells that don't contain a mine have a number in it that indicates the total number of mines in the neighboring cells. Starting off with some arrangement of mines we want to create a Minesweeper game setup. Example For matrix = [[true, false, false], [false, true, false], [false, false, false]] the output sho..
Question Last night you partied a little too hard. Now there's a black and white photo of you that's about to go viral! You can't let this ruin your reputation, so you want to apply the box blur algorithm to the photo to hide its content. The pixels in the input image are represented as integers. The algorithm distorts the input image in the following way: Every pixel x in the output..
Question You are given an array of integers representing coordinates of obstacles situated on a straight line. Assume that you are jumping from the point with coordinate 0 to the right. You are allowed only to make jumps of the same length represented by some integer. Find the minimal length of the jump enough to avoid all the obstacles. Example For inputArray = [5, 3, 6, 7, 9], the output shoul..
neural network에서 활성화 함수는 왜 사용할까? 이런 갑자기 질문을 받았을때 나는 당황할 수 밖에 없었다. cs231n을 들었음에도 불구하고 질문에 대답을 못한다는게 벙찌게 만들었다 이번 기회에 다시 짚고 기억하기 위해 포스팅을 하겠다. 다양한 Activation function을 알아보고 그 중 왜 sigmoid 같은 non-linear한 함수를 주로 사용하는지 짚고 넘어가야한다. Activation function - Linear Function(선형 함수) 먼저 일반적인 직선형 함수이다. 직선형 함수는 neural network에 적합하지 않다. 크게 두 가지 문제가 있다. back prob시의 문제점 back prob을 할 때, 임의의 입력값 x에 대한 f(x)의 미분값(gradient..
Question An IP address is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. There are two versions of the Internet protocol, and thus two versions of addresses. One of them is the IPv4 address. Given a string, find out if it satisfies the IPv4 address naming rules Example For inputString = "1..
Question Given an array of integers, find the maximal absolute difference between any two of its adjacent elements. Example For inputArray = [2, 4, 1, 0], the output should be arrayMaximalAdjacentDifference(inputArray) = 3. Input/Output [execution time limit] 4 seconds (py3) [input] array.integer inputArray Guaranteed constraints: 3 ≤ inputArray.length ≤ 10, -15 ≤ inputArray[i] ≤ 15. [output] in..
Question Call two arms equally strong if the heaviest weights they each are able to lift are equal. Call two people equally strong if their strongest arms are equally strong (the strongest arm can be both the right and the left), and so are their weakest arms. Given your and your friend's arms' lifting capabilities find out if you two are equally strong. Example For yourLeft = 10, yourRi..
Question Given a string, find out if its characters can be rearranged to form a palindrome. Example For inputString = "aabb", the output should be palindromeRearranging(inputString) = true. We can rearrange "aabb" to make "abba", which is a palindrome. Input/Output [execution time limit] 4 seconds (py3) [input] string inputString A string consisting of lowercase English letters. Guaranteed const..