LeetCode Valid Palindrome
Problem Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” i...
Problem Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” i...
Problem Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (...
Problem Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of t...
部署Anaconda 科学计算包,并通过 conda install -c conda-forge tensorflow 部署tensorflow相关包。在ipython环境下执行下列命令下载训练数据包 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_set...
Problem Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? 即直接返回杨辉三...
学习TensorFlow过程中读的一篇文章,索性就翻译出来,虽然收获感觉不是很大。 原文地址:How TensorFlow Works https://github.com/nfmcclure/tensorflow_cookbook/blob/master/01_Introduction/01_How_TensorFlow_Works/01_How_TensorFlow_Works.ip...
Problem Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 没记错的话,这个应该叫杨辉三角型。很简...
Problem Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 ...
Problem Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tr...
Problem Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. class TreeNode: def __...