方式一(将整数转换为字符串,在转换为字符数组): public boolean isPalindrome(int x) { if (x < 0) { return false; } char[] chars = new String(Integer.toString(x)).toCharArray( ...
分类:
其他好文 时间:
2021-04-08 13:10:24
阅读次数:
0
Redis 中 BitMap 的使用场景 BitMap BitMap 原本的含义是用一个比特位来映射某个元素的状态。由于一个比特位只能表示 0 和 1 两种状态,所以 BitMap 能映射的状态有限,但是使用比特位的优势是能大量的节省内存空间。 在 Redis 中,可以把 Bitmaps 想象成一个 ...
分类:
其他好文 时间:
2021-04-08 13:08:56
阅读次数:
0
前期基本数据准备 数据库表可参考mybatisPlus官网快速开始的表(简单测试一下) POJO @Data @AllArgsConstructor @NoArgsConstructor public class User { //对应数据库中的主键(uuid,自增id,雪花算法,redis,zoo ...
分类:
其他好文 时间:
2021-04-08 13:01:23
阅读次数:
0
题目链接:474. 一和零 - 力扣(LeetCode) (leetcode-cn.com) 题目描述: 给你一个二进制字符串数组 strs 和两个整数 m 和 n 。 请你找出并返回 strs 的最大子集的大小,该子集中 最多 有 m 个 0 和 n 个 1 。 如果 x 的所有元素也是 y 的元 ...
分类:
其他好文 时间:
2021-04-08 12:54:38
阅读次数:
0
Markdown学习 标题 三级标题 四级标题 字体 Hello word! Hello word! *Hello word! Hello word! Hello word! 引用 淳无敌 分割线 图片 超链接 点击童无敌 列表 A c d a b c 表格 代码 java ...
分类:
其他好文 时间:
2021-04-07 11:43:53
阅读次数:
0
String、StringBuffer和StringBuilder String 定义 String 是 Java 语言非常基础和重要的类,提供了构造和管理字符串的各种基本逻辑。它是典型的 Immutable(不可改变) 类,被声明成为 final class,所有属性也都是 final 的。也由于 ...
分类:
其他好文 时间:
2021-04-07 11:42:29
阅读次数:
0
package main import ( "log" ) type meta struct { name string age int } func (m *meta) copy(dest *meta) { *dest = *m } func main() { a := meta{name:"aa ...
分类:
编程语言 时间:
2021-04-07 11:39:03
阅读次数:
0
#include<bits/stdc++.h>using namespace std;int maze [5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};typedef struct { ...
分类:
其他好文 时间:
2021-04-07 11:33:01
阅读次数:
0
static void Main(string[] args) { GetMd5(); } public static void GetMd5() { string str = "123"; //创建md5对象,是静态方法。不能new MD5 mymd5 = MD5.Create(); //comp ...
分类:
编程语言 时间:
2021-04-07 11:23:31
阅读次数:
0
Codeforces Round #712 (Div. 2) A题 Déjà Vu 原题链接 题意: 给定一个字符串, 如果是回文串, 能否通过插入一个$a$使其变成非回文串 思路: 先特判一些特殊情况. 对于一般情况, 当$a_{len - i - 1}$位置上非$a$时, 插入一个$a$, 完成 ...
分类:
其他好文 时间:
2021-04-07 11:22:46
阅读次数:
0