- 博客(17)
- 收藏
- 关注
原创 LeetCode069 Sqrt(x)
Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are truncated and only...
2018-08-24 21:14:34 117
原创 python range()和xrange()
range(start, stop[, step])参数说明:start: 计数从 start 开始(默认从 0 开始)。 stop: 计数到 stop 结束(不包括 stop)。 step:步长,默认为1(可以为负数,倒叙)。xrange(start, stop[, step]) 参数说明:与rang()完全相同区别:range()返回的是列表x...
2018-08-24 16:58:44 272
原创 LeetCode067 Add Binary
Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = "11", b = "1"Output: "100"Exam...
2018-08-23 21:17:42 131
原创 LeetCode066 Plus One
Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each element...
2018-08-23 16:38:14 226
原创 LeetCode053 Maximum Subarray
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Explanati...
2018-08-21 20:17:44 155
原创 LeetCode035 Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array....
2018-08-21 19:28:47 115
原创 LeetCode027 Remove Element
Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input arra...
2018-08-20 21:22:19 113
原创 LeetCode026 Remove Duplicates from Sorted Array
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifyi...
2018-08-20 21:04:00 127
原创 LeetCode020 Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of b...
2018-08-20 13:52:35 108
原创 LeetCode009 Palindrome Number
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExpl...
2018-08-16 21:47:28 105
原创 cs231n assignment1 features作业
# Use the validation set to tune the learning rate and regularization strengthfrom cs231n.classifiers.linear_classifier import LinearSVMlearning_rates = [1e-9, 1e-8, 1e-7]regularization_strength...
2018-08-16 15:44:46 960
原创 LeetCode007 Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dea...
2018-08-15 21:48:31 162
原创 LeetCode001 Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same ...
2018-08-15 20:57:58 107
原创 cs231n assignment1 two layer net作业
from __future__ import print_functionimport numpy as npimport matplotlib.pyplot as pltclass TwoLayerNet(object): """ A two-layer fully-connected neural network. The net has an input dimensio...
2018-08-15 19:11:22 787
原创 cs231n assignment1 softmax作业
import numpy as npfrom random import shuffledef softmax_loss_naive(W, X, y, reg): """ Softmax loss function, naive implementation (with loops) Inputs have dimension D, there are C classes, ...
2018-08-13 20:31:15 444
原创 cs231n assignment1 svm作业
import numpy as npfrom random import shuffledef svm_loss_naive(W, X, y, reg): """ Structured SVM loss function, naive implementation (with loops). Inputs have dimension D, there are C class...
2018-08-13 20:30:09 359
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人