Tag：length

Time：2021224
catalog summary SDS (dynamic string) The difference between SDS (dynamic string) and C language string 1. Overview The simple dynamic string SDS implemented by string type bottom layer is a string that can be modified. It uses pre allocation of redundant space to reduce the frequent allocation of memory. 2. SDS dynamic string Dynamic stringSo\0Is […]

Time：2021224
Regular learning class Character class [] An object that conforms to certain characteristics/[ABC] / means to match one of ABC The reverse class [^] is enclosed in brackets^ Example: [^ A] is to match characters that are not a Range class [AZ] It can match any character in AZ Predefined Class Predefined characters: \D is […]

Time：2021223
The fourth step of JPG compression is Huffman coding. The following is mainly about the Huffman coding of JPEG. The picture is quoted from “compressed image file formats, JPEG, PNG, GIF, XBM, BMP – John Miano” [1] 1. Huffman symbol of AC data For AC data, the first four bits to be encoded represent how […]

Time：2021221
Single byte length of string Calculate the length of return single byte and double byte character mixed string #!/usr/bin/env python3 Tips: in generating.xls, .xlsxWhen waiting for a file, you can use this function to calculate the byte length of the cell content and adjust the column width accordingly. This work adoptsCC agreementReprint must indicate the […]

Time：2021221
209. The smallest subarray Title Source: leetcode https://leetcodecn.com/problems/minimumsizesubarraysum subject Given an array containing n positive integers and a positive integer s, find out the smallest continuous subarray in the array which satisfies the sum ≥ s, and return its length. If there is no qualified continuous subarray, return 0. Example: Input: S = 7, nums […]

Time：2021220
When using angularjs for development, form filling is a very common requirement, and form verification is a headache. This paper makes a summary of this. The form used in the angular view is no longer the normal form in HTML, but an instruction encapsulated by angular. It can complete functions that ordinary form can’t realize, […]

Time：2021220
The problem is to find the longest substring in the string that does not contain duplicate characters.The first kind <?php $string = “abcdaefaedkqatlmtx”; function test($string){ $len = strlen($string); $arr = []; for ($i = 1; $i <= $len; $i++) { for($j = 1; $j<= $len; $j++) { //Intercept from 0 to the maximum length, and […]

Time：2021219
summary An array is a sequence of elements of a specific type with a fixed length. An array can be composed of zero or more elements. Once declared, the length of the array is fixed and cannot be changed dynamically. Len() and cap() always return the same result.Declaration array package main import ( “fmt” […]

Time：2021219
Basic operation of redis Use help to query which commands are available Help @ string # query string type command Help @ hash # query hash command Help @ list # query list command Help @ set # query set command Help @ Zset # query Zset command Help @ cluster # query cluster command […]

Time：2021219
Leetcode – duplicate number in array Blog description The information involved in this article comes from Internet collation and personal summary, which means personal learning and experience summary. If there is any infringement, please contact me to delete it. Thank you! explain Sword finger offer, 3 questions Duplicate number in array subject All numbers in […]

Time：2021216
1. Search insertion position https://leetcodecn.com/problems/searchinsertposition/ class Solution { public int searchInsert(int[] nums, int target) { int left=0,right=nums.length1; while(left<=right){ int mid=(left+right)/2; if(nums[mid]<target){ left=mid+1; }else if(nums[mid]>target){ right=mid1; }else{ return mid; } } return left; } } 2. Search for 2D matrix https://leetcodecn.com/problems/searcha2dmatrix/ public boolean searchMatrix(int[][] matrix, int target) { if(matrix.length == 0) return false; int row = […]

Time：2021215
1. Problem: given a string, find out the longest substring without repeating characters The longest unrepeated substring of ABC BC is ABC, and the length of ABC BC is 3 2. Method 1, violence law We can find out each substring, and then find the longest substring without repeating characters. The method is simple […]