Jason Liu

@jason71995

Joined on Sep 29, 2020

  • https://leetcode.com/problems/house-robber/ Description You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night. Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police. Example 1: Input: nums = [1,2,3,1]
     Like  Bookmark
  • https://leetcode.com/problems/coin-change/ Description You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1. You may assume that you have an infinite number of each kind of coin. Example 1: Input: coins = [1,2,5], amount = 11
     Like  Bookmark
  • https://leetcode.com/problems/special-array-with-x-elements-greater-than-or-equal-x/ Description You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums that are greater than or equal to x. Notice that x does not have to be an element in nums. Return x if the array is special, otherwise, return -1. It can be proven that if nums is special, the value for x is unique. Example 1:
     Like  Bookmark
  • https://leetcode.com/problems/validate-stack-sequences/ Description Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack. Example 1: Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] Output: true Explanation: We might do the following sequence:
     Like  Bookmark
  • https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/ Description We are given a binary tree (with root node root), a target node, and an integer value K. Return a list of the values of all nodes that have a distance K from the target node. The answer can be returned in any order. Example 1: Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, K = 2
     Like  Bookmark
  • https://leetcode.com/problems/odd-even-linked-list/ Description Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity. Example 1: Input: 1->2->3->4->5->NULL
     Like  Bookmark
  • https://leetcode.com/problems/rotate-image/ Description You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
     Like  Bookmark
  • https://leetcode.com/problems/add-two-numbers/ Description You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example 1: Input: l1 = [2,4,3], l2 = [5,6,4]
     Like  Bookmark
  • "Please design an activation function for image classification and explain why." I like to ask the question whenever interviewing an experienced candidate. Unfortunately, I usually received answers like Sigmoid, ReLU or LeackyReLU. For me, understanding activation functions means how much deep learning knowledge an interviewee has. Therefore, in this article, I will go through common activation functions. Step Function $$ f(x)=\begin{cases} 1,&\text{if}\ x>0\ 0,&\text{otherwise} \end{cases} $$
     Like  Bookmark