04 2022 档案
leetcode 176. Second Highest Salary
摘要:# Write your MySQL query statement below select (select distinct Employee.Salary from Employee order by Employee.Salary desc limit 1 offset 1) as Seco 阅读全文
posted @ 2022-04-15 09:56 黎酒 阅读(24) 评论(0) 推荐(0)
leetcode 669. Trim a Binary Search Tree
摘要:class trimBST { public TreeNode trimBST(TreeNode root, int low, int high) { if(root == null){ return root; } if(root.val < low){ return trimBST(root.r 阅读全文
posted @ 2022-04-15 09:45 黎酒 阅读(29) 评论(0) 推荐(0)
leetcode 289. Game of Life
摘要:class GameOfLife { public static void gameOfLife(int[][] board) { int[][] copy = new int[board.length][board[0].length]; for(int i = 0; i < board.leng 阅读全文
posted @ 2022-04-14 19:15 黎酒 阅读(31) 评论(0) 推荐(0)
700. Search in a Binary Search Tree
摘要:class Solution { public TreeNode searchBST(TreeNode root, int val) { return treeTravsal(root, val); } private TreeNode treeTravsal(TreeNode root, int 阅读全文
posted @ 2022-04-14 18:57 黎酒 阅读(30) 评论(0) 推荐(0)
215. Kth Largest Element in an Array
摘要:class KthLargestElementInAnArray { public int findKthLargest(int[] nums, int k) { PriorityQueue<Integer> minHeap = new PriorityQueue<>(); for (int i = 阅读全文
posted @ 2022-04-12 10:41 黎酒 阅读(31) 评论(0) 推荐(0)
682. Baseball Game
摘要:public class BaseballGame { public static int calPoints(String[] ops) { Deque<Integer> stack = new ArrayDeque<>();int sum = 0; for(String op: ops){ if 阅读全文
posted @ 2022-04-10 19:53 黎酒 阅读(40) 评论(0) 推荐(0)
Java concurrency 101
摘要:java.util.concurrent - Java's low-level concurrency primitives synchronized/volatile/wait/notify/notifyall 常见问题:deadlock 死锁,thread starvation 线程饥饿, ra 阅读全文
posted @ 2022-04-09 18:52 黎酒 阅读(47) 评论(0) 推荐(0)
2224. Minimum Number of Operations to Convert Time
摘要:public class MinimumNumberofOperationstoConvertTime { public static int convertTime(String current, String correct) { String[] currentArray = current. 阅读全文
posted @ 2022-04-07 18:16 黎酒 阅读(64) 评论(0) 推荐(0)
JSON学习笔记
摘要:{ "firstName": "John", "lastName": "Smith", "sex": "male", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY" 阅读全文
posted @ 2022-04-07 17:39 黎酒 阅读(63) 评论(0) 推荐(0)
Leetcode 424. Longest Repeating Character Replacement
摘要:You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can 阅读全文
posted @ 2022-04-07 17:38 黎酒 阅读(33) 评论(0) 推荐(0)
Leetcode 1004. Max Consecutive Ones III
摘要:Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's. import java.util. 阅读全文
posted @ 2022-04-07 17:35 黎酒 阅读(30) 评论(0) 推荐(0)
Leetcode 3. Longest Substring Without Repeating Characters
摘要:class LengthOfLongestSubstring { public static int lengthOfLongestSubstring(String s) { int start = 0, end = 0, maxLength = 0; HashMap<Character, Inte 阅读全文
posted @ 2022-04-07 10:08 黎酒 阅读(19) 评论(0) 推荐(0)
@RequestBody 注解 与 视图对象 view object
摘要:Spring web应用通过客服端发送HTTP请求,当HTTP 客服端发送请求和数据时,数据包含在 request body中。因此,spring程序需要使用@RequestBody读取数据,并转换为处理对象。 @RequestBody 一般与 @PostMapping 结合,RequestBody 阅读全文
posted @ 2022-04-06 15:12 黎酒 阅读(133) 评论(0) 推荐(0)