[leetcode] 155. Min Stack @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86575596 原题 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() – Removes the element o
[leetcode] 141. Linked List Cycle @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86577807 原题 https://leetcode.com/problems/linked-list-cycle/ 解法1 遍历链表, 将已见过的节点放入seen, 如果遇到已见过的节点则返回True, 遍历结束如果没发现重复的节点则返回False. Time: O(n) Space: O(1) 代码 # Definition for sing
[leetcode] 784. Letter Case Permutation @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86580919 原题 Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could c
[leetcode] 7. Reverse Integer @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86581365 原题 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21
[leetcode] 695. Max Area of Island @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86589758 原题 Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume a
[leetcode] 739. Daily Temperatures @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86592180 原题 Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature.
[leetcode] 168. Excel Sheet Column Title @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86584441 原题 Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A
2 -> B
3 -> C
...
26 -> Z
27 -> AA
28 -> AB
...
E
[leetcode] 419. Battleships in a Board @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86593705 原题 Given an 2D board, count how many battleships are in it. The battleships are represented with 'X’s, empty slots are represented with '.'s. You may assume the follow
[leetcode] 547. Friend Circles @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86597212 原题 There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B,
[leetcode] 22. Generate Parentheses @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86599763 原题 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ “((()))”, “((
[leetcode] 347. Top K Frequent Elements @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86600911 原题 Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input: nums = [1],
[leetcode] 238. Product of Array Except Self @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86601341 原题 Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Exampl
[leetcode] 503. Next Greater Element II @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86602282 原题 Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The Next Greater N
[leetcode] 216. Combination Sum III @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86604314 原题 Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set o
[leetcode] 655. Print Binary Tree @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86605281 原题 Print a binary tree in an m*n 2D string array following these rules: The row number m should be equal to the height of the given binary tree. The column number n sh
[leetcode] 529. Minesweeper @ python
版权声明:版权归个人所有,未经博主允许,禁止转载 https://blog.csdn.net/danspace1/article/details/86607795 原题 https://leetcode.com/problems/minesweeper/ 解法 DFS. Base case是board为空时, 返回[]. 定义DFS函数, base case是当前位置的值不是’E’, 直接返回. 我们先计算click位置的相邻位置有多少个’M’, 将click位置更新, 注意: 如果click
python—Flask学习1---虚拟环境的创建及使用
虚拟环境: 虚拟环境是安装Flask最方便的方法,在虚拟环境中,我们可以安装私有包,可以避免Python版本和包与系统预装的包发生冲突,为项目创建虚拟环境,可以保证应用只能访问所在虚拟环境中的包,使用虚拟环境可以不需要管理员权限。 创建虚拟环境: 第一步:配置python环境。 1.用鼠标右击我的电脑,打开属性。 2.选择高级系统设置。 3.点击环境变量。 4.找到系统变量中的Path变量。 5.在原来的系统变量的后面加英文输入法模式下的";" 后面加上Python的安装路径。 6.点击确定,
20190123工作总结
服务器不能调用软件,提示失败,登录服务器login界面发现登录不上去,查看catalina.out文件内容,发现DEBUG错误;查询tomcat状态,ps-ef|grepcomcat,显示未开启,关闭tomcat,./shutdown.sh,重新启动./startup.sh,;程序恢复正常;上周也有一次类似情况,看来还是程序本身有问题;还没找到,明天还要继续监控啊!
python—Flask学习2------项目的创建及虚拟环境的配置
一、创建项目。 1.打开Pycharm 2.点击file,选择new project 3.选择Flask 4.在Location框中选择文件位置,可以是默认位置也可以是自定义的位置 也可以自定义文件名。 5.点击create,创建成功 二、配置虚拟环境。 1.安装 virtualenvwrapper-win 在控制台中输入以下代码: pip install virtualenvwrapper-win 2.使用workon查看是否安装成功 直接在控制台输入:workon 3.通过新方法新建虚拟环
python—Flask学习3------输出"Hello World"
1.打开创建的Flask项目 2.将已有的代码删除 3.点击File,点击settings 4.点击project,点击project interpreter 5.找到pip并点击,在搜索框中输入Flask 6.点击Install Package 7.输入以下代码: from flask import Flask #从flask 包中导入Flask方法 app = Flask(name) #应用实例: @app.route(’/’) #路由 def index(): #视图函数 return
今日推荐
周排行