- 博客(17)
- 收藏
- 关注
原创 162. Find Peak Element
A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in
2017-06-26 14:18:19 353
原创 66. Plus One
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digi
2017-06-26 14:11:12 403
原创 CodeM美团点评B轮:子串(E题) Java暴力解决
给出一个正整数n,我们把1..n在k进制下的表示连起来记为s(n,k),例如s(16,16)=123456789ABCDEF10, s(5,2)=11011100101。现在对于给定的n和字符串t,我们想知道是否存在一个k(2 ≤ k ≤ 16),使得t是s(n,k)的子串。 输入描述:第一行一个整数n(1 ≤ n ≤ 50,000)。第二行一个字符串t(长度 ≤ 1,000,0
2017-06-25 18:51:27 491
原创 540. Single Element in a Sorted Array
Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once.Example 1:Input: [
2017-06-23 17:45:53 341
原创 219. Contains Duplicate II
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at
2017-06-23 17:43:49 237
原创 119. Pascal's Triangle II
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?Subscrib
2017-06-20 16:02:20 269
原创 118. Pascal's Triangle
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]]思路:杨辉三角 很简单的逻辑判断 但看了某大神的代码 还
2017-06-19 12:41:49 322
原创 angluarjs flask 前后台数据交互传递 异步请求
作为python的初学者 找文档找资料 搞了一天多 终于知道后台flask与前台angluarjs如何数据的交互angluarjs数据的传值 主要是使用&http传值 AngularJS 应用组成如下:View(视图), 即 HTML。Model(模型), 当前视图中可用的数据。Controller(控制器), 即 JavaScript 函数,可以添加或修改属性。
2017-06-13 13:39:26 3577 1
原创 35. 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.
2017-06-09 18:24:38 291
原创 53. Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] ha
2017-06-08 21:47:29 251
原创 169. Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority elemen
2017-06-08 20:59:55 469
原创 238. Product of Array Except Self
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O
2017-06-07 20:52:12 492
原创 217. Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element
2017-06-07 20:48:32 410
原创 python爬虫入门
初学者要学会基本的爬虫先要安装包requestsrequests的安装1. 下载requests 打开这个网址, http://www.lfd.uci.edu/~gohlke/pythonlibs 在这个网站上面有很多 python 的第三方库文件,我们按 ctrl+f 搜索很容易找到 requests 。如下图,点击那个 .whl 文件
2017-06-06 10:28:56 504
原创 python Flask框架数据库一对多关系,监听器
作为python的初学者,今天学习了如何使用python代码建立一对多的关系,触发器,监听器的简单操作class Post(db.Model): __tablename__ ='posts' id = db.column(db.Integer,primary_key=True) title = db.column(db.String) body = db.col
2017-06-04 18:49:52 1082
原创 Flask-SQLAlchemy配置连接MySQL及表的生成
作为初学者,通过小的项目学习了如何使用Flask-SQLAlchemy连接MySQL以及表的生成这是python配置数据库的格式一先安装flask_sqlAlchemy包pip install flask-sqlalchemy二、配置flask-sqlalchemy连接MySQL数据库 from flask_sqlalchemy import SQLAlchemyapp =
2017-06-03 16:50:26 1871
原创 关于python Nav框架的问题
由于初学者 刚学 有些知识没学到位花了一天时间找错误 才发现是路径跳转的问题 汗!!项目结构:子结构及代码:# -*- coding:utf-8 -*-from flask import Flask, render_templatefrom flask_bootstrap import Bootstrapfrom flask_nav impo
2017-06-03 11:09:03 1618
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人