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
阅读全文
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
阅读全文
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
阅读全文
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
阅读全文
215. Kth Largest Element in an Array
摘要:class KthLargestElementInAnArray { public int findKthLargest(int[] nums, int k) { PriorityQueue<Integer> minHeap = new PriorityQueue<>(); for (int i =
阅读全文
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
阅读全文
Java concurrency 101
摘要:java.util.concurrent - Java's low-level concurrency primitives synchronized/volatile/wait/notify/notifyall 常见问题:deadlock 死锁,thread starvation 线程饥饿, ra
阅读全文
2224. Minimum Number of Operations to Convert Time
摘要:public class MinimumNumberofOperationstoConvertTime { public static int convertTime(String current, String correct) { String[] currentArray = current.
阅读全文
JSON学习笔记
摘要:{ "firstName": "John", "lastName": "Smith", "sex": "male", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY"
阅读全文
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
阅读全文
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.
阅读全文
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
阅读全文
@RequestBody 注解 与 视图对象 view object
摘要:Spring web应用通过客服端发送HTTP请求,当HTTP 客服端发送请求和数据时,数据包含在 request body中。因此,spring程序需要使用@RequestBody读取数据,并转换为处理对象。 @RequestBody 一般与 @PostMapping 结合,RequestBody
阅读全文
浙公网安备 33010602011771号