自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 收藏
  • 关注

原创 最长重复子串

class Solution { long mod = (long)Math.pow(2, 37) - 1; long a = 26; int nums[]; int n; public String longestDupSubstring(String S) { nums = new int [S.length()]; for (int i = 0; i < S.length(); i ++) { num

2020-10-21 20:12:08 116

原创 前缀树

class Trie { TrieNode root; /** Initialize your data structure here. */ public Trie() { root = new TrieNode(); } /** Inserts a word into the trie. */ public void insert(String word) { TrieNode cur = root;

2020-10-15 20:37:59 81

原创 前缀树

class Trie { private final int SIZE = 26; private TrieNode root; // TrieNode class TrieNode { // 多少单词通过这个节点,即由根至该节点组成的字符串模式出现的次数 private int num; // 所有的儿子节点 private TrieNode[] son; // 是不是最后一个节点

2020-10-15 20:31:10 84

原创 前缀树

在这里插class Trie { private final int ALPHABET_SIZE = 26; private Trie[] children = new Trie[ALPHABET_SIZE]; boolean isEndOfWord = false; public Trie() {} public void insert(String word) { Trie tmp = this; for (char i

2020-10-15 20:27:02 66

原创 2020-09-26

class Solution { public int tilingRectangle(int n, int m) { int INF = 0x3f3f3f3f; int[][] dp = new int[n + 1][m + 1]; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ //如果是正方形

2020-09-26 20:02:14 49

原创 2020-09-23

// javaclass Solution { public int longestCommonSubsequence(String text1, String text2) { int m = text1.length(), n = text2.length(); int[][] dp = new int[m + 1][n + 1]; for (int i = 0; i < m; i++) { for (int j

2020-09-23 19:39:09 46

原创 2020-09-18

import java.util.ArrayDeque;import java.util.ArrayList;import java.util.Arrays;import java.util.Deque;import java.util.List;public class Solution { public List<List<Integer>> combinationSum(int[] candidates, int target) { int

2020-09-18 18:57:04 117

原创 2020-09-15

class Solution { private class LargerNumberComparator implements Comparator<String> { @Override public int compare(String a, String b) { String order1 = a + b; String order2 = b + a; return order

2020-09-15 17:09:24 44

原创 2020-09-15

class Solution { private class LargerNumberComparator implements Comparator<String> { @Override public int compare(String a, String b) { String order1 = a + b; String order2 = b + a; return order2.com

2020-09-15 17:08:53 57

原创 2020-09-14

class Solution { public String rearrangeString(String s, int k) { if(s == null || s.length() == 0){ return s; } HashMap<Character, Integer> hm = new Integer>(); for(int i = 0; i<s.length(); i++){

2020-09-14 20:53:21 54

原创 2020-09-14

class Solution { public double[] medianSlidingWindow(int[] nums, int k) { double[] result = new double[nums.length - k + 1]; if (k == 1) { for (int i = 0; i < result.length; i ++) { result[i] = (double) nu

2020-09-14 19:48:04 50

原创 2020-09-13

class Solution { public List<List<Integer>> threeSum(int[] nums) { Arrays.sort(nums); List<List<Integer>> res = new ArrayList<>(); for(int k = 0; k < nums.length - 2; k++){ if(nums[k]

2020-09-13 16:19:37 77

原创 2020-09-09

class Solution { public boolean exist(char[][] board, String word) { boolean[][] visited = new boolean[board.length][board[0].length]; for (int i = 0; i < board.length; i++) { for (int j = 0; j < board[0].length; j++)

2020-09-09 20:19:41 78

原创 2020-09-09

class Solution {public boolean exist(char[][] board, String word) {boolean[][] visited = new boolean[board.length][board[0].length];for (int i = 0; i < board.length; i++) {for (int j = 0; j < board[0].length; j++) {if (word.charAt(0) == board[i]

2020-09-09 20:17:52 51

原创 2020-09-09

class Solution { public List<List<Integer>> pacificAtlantic(int[][] matrix) { List<List<Integer>> res = new ArrayList<>(); if(matrix == null || matrix.length == 0){ return res; }

2020-09-09 19:17:20 90

转载 mysql 服务无法启动 服务没有报告任何错误

https://www.cnblogs.com/iseekv/p/11519790.html

2020-08-12 16:49:20 70

原创 IDEA快捷键

idea常用的快捷键Alt+回车 导入包,自动修正Ctrl+N 查找类Ctrl+Shift+N 查找文件Ctrl+Alt+L 格式化代码Ctrl+Alt+O 优化导入的类和包Alt+Insert 生成代码(如get,set方法,构造函数等)Ctrl+E或者Alt+Shift+C 最近更改的代码Ctrl+R 替换文本Ctrl+F 查找文本Ctrl+Shift+Space 自动补全代码Ctrl+空格 代码提示Ctrl+Alt+Space 类名或接口名提示Ctrl+P 方法参数提

2020-07-30 16:28:54 69

原创 使用junit测试,找不到org.junit,/hamcrest/SelfDescribing错误

总结一下自己的心路历程。1.按照https://www.cnblogs.com/qinxu/p/7844964.html步骤按照了junit相关插件如果像我这样没有browse repository在下面,直接在搜索框里搜一下,然后再搜索junit,就能找到了2.报错。说找不到org.junithttps://blog.csdn.net/he99774/article/details/782542622.报java.lang.NoClassDefFoundError: org/hamcrest/

2020-07-02 10:39:33 549

原创 牛客网 剑指offer出现 cannot find symbol的解决方法

思路和题解一模一样,为什么就是不通过?那你一定是忘记了加import!!!在给出的程序的第一行加入import java.util.*;万事大吉!

2020-05-15 22:53:58 1393

原创 python 数组与常数相乘 a = [0]*x 格式含义

参考 https://blog.csdn.net/qq_40549751/article/details/80727884```pythonimport sysa = "12352523452334"num = len(a)k = int(num/3)print(k)#[0]是一个str类型,K个str组成sub数组,list类型sub = [0]*kfor i in ran...

2020-04-27 18:31:27 4258

原创 tensorflow-gpu检查是否用gpu工作

为什么会输出两个设备?运行的时候需要指定吗?

2019-05-28 16:15:51 3440 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除