字符串处理常常用在处理服务器回传的数据、动态拼接生成html等,是前端面试的必考题。 我觉得字符串处理这种常用到的,一定要了然于心,不然用到时急急忙忙去翻手册费半天。 入正题,首先提出平常遇到的几个需求,后面我们来一步一步解决它: 需求1:根据服务器返回的json数据,动态添加元素到列表<ul> 【 ...
分类:
Web程序 时间:
2016-11-05 18:00:48
阅读次数:
263
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:
其他好文 时间:
2016-11-05 17:28:13
阅读次数:
147
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 comple ...
分类:
编程语言 时间:
2016-11-05 15:01:33
阅读次数:
317
Straight-forward strategy.. please take care of all details - data type, assignment order etc. ...
分类:
其他好文 时间:
2016-11-05 14:31:42
阅读次数:
198
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title>d ...
分类:
其他好文 时间:
2016-11-04 16:35:16
阅读次数:
190
Maximum sum Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 39599 Accepted: 12370 Description Given a set of n integers: A={a1, a2,..., an} ...
分类:
其他好文 时间:
2016-11-04 01:25:01
阅读次数:
259
ComputeSVD 构建一个4×5的矩阵M: M矩阵的奇异值分解后奇异矩阵s应为: 4 0 0 0 0 0 3 0 0 0 0 0 √5 0 0 0 0 0 0 0 我们将通过ComputeSVD函数进行验证. <一> 构造RowMatrix矩阵:M scala> val M = new RowM ...
分类:
其他好文 时间:
2016-11-04 01:14:11
阅读次数:
316
Problem: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the f ...
分类:
其他好文 时间:
2016-11-03 09:30:34
阅读次数:
171
题目本身:https://leetcode.com/problems/sliding-window-maximum/ Given an array nums, there is a sliding window of size k which is moving from the very left ...
步骤:H5代码 <html> <head> <meta charset="UTF-8"> <title>交互Demo</title> <meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-widt ...
分类:
Web程序 时间:
2016-11-02 17:37:55
阅读次数:
357