字符串 字符 单词leetcode

leetcode-1464-easy

Maximum Product of Two Elements in an Array Given the array of integers nums, you will choose two different indices i and j of that array. Return the ......
leetcode 1464 easy

leetcode-1512-easy

Number of Good Pairs Given an array of integers nums, return the number of good pairs. A pair (i, j) is called good if nums[i] == nums[j] and i < j. E ......
leetcode 1512 easy

leetcode-1550-easy

Three Consecutive Odds Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. Examp ......
leetcode 1550 easy

leetcode-1572-easy

Matrix Diagonal Sum Given a square matrix mat, return the sum of the matrix diagonals. Only include the sum of all the elements on the primary diagona ......
leetcode 1572 easy

[LeetCode] 1688. Count of Matches in Tournament

You are given an integer n, the number of teams in a tournament that has strange rules: If the current number of teams is even, each team gets paired ......
Tournament LeetCode Matches Count 1688

Leetcode 80. 删除有序数组中的重复项 II

被前面类似的题禁锢了思路,自己写的双指针,感觉题解很巧妙,记录一下。这个解法不用记录cnt。 通用解法 为了让解法更具有一般性,我们将原问题的「保留 2 位」修改为「保留 k 位」。 对于此类问题,我们应该进行如下考虑: 由于是保留 k 个相同数字,对于前 k 个数字,我们可以直接保留 对于后面的任 ......
数组 Leetcode 80 II

Leetcode刷题day6-哈希表.双指针.三~四数求和.

454.四数相加Ⅱ 454. 四数相加 II - 力扣(LeetCode) 给你四个整数数组 nums1、nums2、nums3 和 nums4 ,数组长度都是 n ,请你计算有多少个元组 (i, j, k, l) 能满足: 0 <= i, j, k, l < n nums1[i] + nums2[ ......
指针 Leetcode day6 day

字符的编码方式(ASCII、ANSI、Unicode)

本篇博客大致介绍了字符的三种编码格式:ASCII、ANSI、Unicode,并比较浅显的解释了其编码过程,在写这篇博客的时候,参考了以下链接: 【字符编码】彻底理解字符编码 - leesf - 博客园 (cnblogs.com) 一篇搞懂Unicode ANSI UTF8等字符编码 - 知乎 (zh ......
字符 编码 Unicode 方式 ASCII

01-字符串

课程:字符串 目标 认识字符串 下标 切片 常用操作方法 一. 认识字符串 字符串是 Python 中最常用的数据类型。我们一般使用引号来创建字符串。创建字符串很简单,只要为变量分配一个值即可。 a = 'hello world' b = "abcdefg" print(type(a)) print ......
字符串 字符 01

[LeetCode Hot 100] LeetCode19. 删除链表的倒数第N个结点

题目描述 思路一:采用两次遍历 第一遍遍历先获取链表的长度length 第二次从dummy节点开始走length - n步 然后将该节点指向下下个节点 思路二:采用一次遍历 设置虚拟节点dummyHead指向head 设定双指针p和q,初始都指向虚拟节点dummyHead 移动q,直到p与q之间相隔 ......
LeetCode 结点 Hot 100 19

cw 字符串专题

KMP 和 AC 自动机都只会背板子怎么办啊 /kk。 模板 AC 自动机 不会,但我会背板子。 for(int i=0;i<26;i++) ch[0][i]=1; queue<int> q;q.push(1); while(!q.empty()) { int u=q.front();q.pop() ......
字符串 字符 专题 cw

my编程单词

freedom silence 沉默;寂静;无声; call of silence free 自由的;免费的;空闲的;免税的;自然的, 不拘束的; You will know you're reborn tonight 你会知道今晚你重生 Must be alright, but I stay by ......
单词

[LeetCode Hot 100] LeetCode21. 合并两个有序链表

题目描述 思路:新建dummy去"穿针引线" 新建一个dummy节点去"穿针引线" 注意最后返回的是dummy.next 方法一: /** * Definition for singly-linked list. * public class ListNode { * int val; * List ......
LeetCode 两个 Hot 100 21

字符编码

字符编码 【1】阶段一:一家独大(ASCII) (1)ASCII表的诞生 现代计算机起源于美国,所以最先考虑仅仅是让计算机识别英文字符,于是诞生了ASCII表 (2)ASCII表的特点 只有英文字符与数字的一一对应关系 一个英文字符对应1Bytes,1Bytes=8bit,8bit最多包含256个数 ......
字符 编码

template包 字符串函数

字符串函数 https://blog.gmem.cc/gotpl 函数 说明 abbrev 缩写参数,超出的字符以...代替。例如 abbrev 5 "hello world"输出 he... abbrevboth abbrevboth N STR:从双侧缩写 trunc trunc N STR:截 ......
字符串 函数 字符 template

HTML学习笔记七:html-字符实体和全局属性

HTML学习笔记七:html-字符实体和全局属性 MDN元素查询地址 所有的html的元素我们都可以通过以下地址进行相关的查询和理解。 https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/meta 字符实体 用特定代码来表示一个符号,即 ......
全局 实体 字符 属性 笔记

RK3568,字符设备框架:管理同主设备号、不同次设备号设备

字符设备框架:管理同主设备号、不同次设备号设备 以下代码针对迅为开发板RK3568,开发板系统是ubuntu20.04, 正文 以下是我写的字符设备框架,实现了管理同主设备号、不同次设备号的功能。 代码: private_data_test.c #include <linux/init.h> #in ......
设备 主设备 字符 框架 3568

程序员学英语-基础词1200个单词3

boy 男孩 n bo(伯父) y 树丫 伯父在树丫后和小男孩玩 both 两个、不仅....而且... pron bo(伯父) th(桃花) 伯父手里有两个桃花 boss 老板、总经理、领导 n bo(伯父) ss(两条蛇) 伯父成为了两条蛇的老板 body 身体 n bo(伯父) dy(抖音) ......
学英语 程序员 单词 基础 程序

代码随想训练营第五十六天(Python)| 583. 两个字符串的删除操作、72. 编辑距离

583. 两个字符串的删除操作 class Solution: def minDistance(self, word1: str, word2: str) -> int: n, m = len(word1), len(word2) # dp 数组代表使得 word1 以 i-1 结尾和 word2 ......
训练营 字符串 随想 字符 两个

Java 时间戳与格式化字符串互转

直接看代码: import java.text.SimpleDateFormat; import java.util.Date; public class Timestamp2DateFormatUsage { public static void main(String[] args) { Sys ......
字符串 字符 格式 时间 Java

java字符串 加上n个"|--",与过滤处理

/***** * original,左边扩充n个"-" * @param n * @param original * @return */ private String fullStr(int n,String original){ StringBuilder sb = new StringBuil ......
quot 字符串 字符 java

[LeetCode Hot 100] LeetCode234. 回文链表

题目描述 思路1:将值复制到数组中然后使用双指针 计算链表的长度 创建等长的数组 将链表中的数依次放入数组中 使用左右指针判断链表是否是回文链表 时间复杂度:O(n) 空间复杂度:O(n) 思路2:快慢指针+反转链表 用快慢指针,快指针走两步,慢指针走一步,快指针遇到终止位置时,慢指针就在链表中间位 ......
LeetCode 回文 Hot 100 234

[LeetCode Hot 100] LeetCode206. 反转链表

题目描述 思路:双指针算法 方法一: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) ......
LeetCode Hot 100 206

[LeetCode Hot 100] LeetCode49. 字母异位词

题目描述 思路:哈希表 对字符串排序,如果是异位词,排序后就变成一样的了。 方法一: class Solution { public List<List<String>> groupAnagrams(String[] strs) { Map<String, List<String>> map = n ......
LeetCode 字母 Hot 100 49

[LeetCode Hot 100] LeetCode141. 环形链表

题目描述 思路:快慢指针 slow指针:每次移动一个节点 fast指针:每次移动两个节点 如果链表中存在环,fast指针最终会在某一时刻追上slow指针,这是由于移动速度快的fast指针会在某个时刻绕圈并追上速度慢的slow指针 条件 fast != null && fast.next != nul ......
LeetCode 环形 Hot 100 141

[LeetCode] 2264. Largest 3-Same-Digit Number in String

You are given a string num representing a large integer. An integer is good if it meets the following conditions: It is a substring of num with length ......
Same-Digit LeetCode Largest Number String

LeetCode-Java:55.跳跃游戏

题目 给你一个非负整数数组 nums ,你最初位于数组的 第一个下标 。数组中的每个元素代表你在该位置可以跳跃的最大长度。 判断你是否能够到达最后一个下标,如果可以,返回 true ;否则,返回 false 。 示例 1: 输入:nums = [2,3,1,1,4] 输出:true 解释:可以先跳 ......
LeetCode-Java LeetCode Java 55

python中级之字符编码

小引 字符编码(Character Encoding)是计算机显示文本的基础,是每一位 IT 从业者必知的计算机基础知识点,如同数值在计算中如何存储表示,那么基础,那么重要。 参考笔记 字符编码笔记:ASCII,Unicode 和 UTF-8 - 阮一峰的网络日志 (ruanyifeng.com) ......
字符 编码 python

字符编码

编码 编码,文字和二进制之间的一个对照表。 1.1 ascii编码 ascii规定使用1个字节来表示字母与二进制的对应关系。 00000000 00000001 w 00000010 B 00000011 a ... 11111111 2**8 = 256 1.2 gb-2312编码 gb-2312 ......
字符 编码

【python入门之文字符编码】---字符编码

简介 计算机中储存的信息都是用二进制数表示的;而我们在屏幕上看到的英文、汉字等字符是二进制数转换之后的结果。通俗的说,按照何种规则将字符存储在计算机中,如’a’用什么表示,称为"编码";反之,将存储在计算机中的二进制数解析显示出来,称为"解码",如同密码学中的加密和解密。在解码过程中,如果使用了错误 ......
编码 字符 文字 python
共12000篇  :16/400页 首页上一页16下一页尾页