Leetcode 0249: Group Shifted Strings

题目描述:Given a string, we can “shift” each of its letter to its successive letter, for example: “abc” -> “bcd”. We can keep “shifting” which forms the sequence:“abc” -> “bcd” -> … -> “xyz”Given a list of non-empty strings which contains only
分类: 其他 发布时间: 02-26 23:48 阅读次数: 0

Leetcode 0246: Strobogrammatic Number

题目描述:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to determine if a number is strobogrammatic. The number is represented as a string.Example 1:Input: num = “69”Output: tr
分类: 其他 发布时间: 02-26 23:47 阅读次数: 0

Leetcode 0247: Strobogrammatic Number II

题目描述:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Find all strobogrammatic numbers that are of length = n.Example:Input: n = 2Output: [“11”,“69”,“88”,“96”]Time complexity: O(n)Space c
分类: 其他 发布时间: 02-26 23:47 阅读次数: 0

Leetcode 0248: Strobogrammatic Number III

题目描述:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to count the total strobogrammatic numbers that exist in the range of low <= num <= high.Example 1:Input: low = “50
分类: 其他 发布时间: 02-26 23:47 阅读次数: 0

Leetcode 0243: Shortest Word Distance

题目描述:Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list.Example :Assume that words = [“practice”, “makes”, “perfect”, “coding”, “makes”].Input: word1 = “coding”, word2 = “practice”
分类: 其他 发布时间: 02-26 23:47 阅读次数: 0

Leetcode 0244: Shortest Word Distance II

题目描述:Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the shortest distance between these two words in the list. Your method will be called repeatedly many times wit
分类: 其他 发布时间: 02-26 23:46 阅读次数: 0

Leetcode 0245: Shortest Word Distance III

题目描述:Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list.word1 and word2 may be the same and they represent two individual words in the list.Example :Assume that words = [“practice”,
分类: 其他 发布时间: 02-26 23:46 阅读次数: 0

Leetcode 0236: Lowest Common Ancestor of a Binary Tree

题目描述:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and
分类: 其他 发布时间: 02-26 23:46 阅读次数: 0

Leetcode 0238: Product of Array Except Self

题目描述: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].Example :Input: [1,2,3,4]Output: [24,12,8,6]Constraint:It’s guaranteed that th
分类: 其他 发布时间: 02-26 23:46 阅读次数: 0

Leetcode 0239: Sliding Window Maximum

题目描述:You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.R
分类: 其他 发布时间: 02-26 23:45 阅读次数: 0

Leetcode 0240: 搜索二维矩阵 II Search a 2D Matrix II

题目描述:Write an efficient algorithm that searches for a target value in an m x n integer matrix. The matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers in each column are sorted in ascending from
分类: 其他 发布时间: 02-26 23:45 阅读次数: 0

Leetcode 0241: 为运算表达式设计优先级 Different Ways to Add Parentheses

题目描述:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.中文描述:给定一个含有数字和运算符的字符串,为表达式添加括号,改变其运算优先级以求出不同的结果。你需要给出所有可能的组合的结
分类: 其他 发布时间: 02-26 23:45 阅读次数: 0

Leetcode 0264: 丑数 II Ugly Number II

题目描述:Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.中文描述:编写一个程序,找出第 n 个丑数。丑数就是质因数只包含 2, 3, 5 的正整数。Example:Input: n = 10Output: 12Explanation: 1, 2, 3, 4, 5, 6, 8, 9, 10,
分类: 其他 发布时间: 02-26 23:45 阅读次数: 0

Grokking the System Design Interview: 如何应对系统设计面试

第一课系统设计过程中的几大步骤:Step 1: 需求澄清(Requirments Clarification)Step 3:粗略估算 (Back-of-the-envelope Estimation )Step 4:系统接口定义 (System Interface Definition)Step 4:定义数据模型 (Defining Data Model)Step 5:高级定义 (High Level Design)Step 6:细节设计(Detailed Design)Step 7:识别
分类: 其他 发布时间: 02-26 23:44 阅读次数: 0

Leetcode 0273: 整数转换英文表示 Integer to English Words

题目描述:Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.中文描述:编写一个程序,找出第 n 个丑数。丑数就是质因数只包含 2, 3, 5 的正整数。Example:Input: n = 10Output: 12Explanation: 1, 2, 3, 4, 5, 6, 8, 9, 10,
分类: 其他 发布时间: 02-26 23:44 阅读次数: 0

Leetcode 0274: H 指数 H-Index

题目描述:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-index on Wikipedia: “A scientist has index h if h of his/her N papers have
分类: 其他 发布时间: 02-26 23:44 阅读次数: 0

删除Docker镜像报错image is being used by stopped container

当删除某个镜像出现下面错误时:[root@VM-0-5-centos ~]# docker rmi bf756fb5e37Error response from daemon: conflict: unable to delete bf756fb5e37 (must be forced) - image is being used by stopped container 8c5983524kj4处理方法:docker ps -adocker rm 8c5983524kj4 #根
分类: 其他 发布时间: 02-26 23:44 阅读次数: 0

解决docker里面显示bash: vim: command not found

确认系统类型cat /proc/versionLinux version 3.10.0-1127.19.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Aug 25 17:23:54 UTC 2020RedHat系列:Redhat、Centos、Fedora等,包管理工具是yumRedHat系统vi..
分类: 其他 发布时间: 02-26 23:43 阅读次数: 0

小程序调用地图接口

wxml代码:<view class="location-box1"> <image src="../../images/tabBar/location_on.png" bindtap="go"></image></view>js代码:/** *在page对象前引入文件 */var QQMapWX = require('../../wxParse/qqmap-wx-jssdk.js');var qqmapsdk ;/.
分类: 其他 发布时间: 02-26 23:43 阅读次数: 0

利用nginx实现负载均衡2

1、根据IP分流2、根据URL分流3、根据权重4、根据响应时间NGINX负载均衡分发请求的几种方式1、轮询(默认)每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除。2、weight指定轮询几率,weight和访问比率成正比,用于后端服务器性能不均的情况。3、ip_hash每个请求按访问ip的hash结果分配,这样每个访客固定访问一个后端服务器,可以解决session的问题。4、fair(第三方)按后端服务器的响应时间来分配请求,响应时间短的优先分
分类: 其他 发布时间: 02-26 23:43 阅读次数: 0