LeetCode 2037.

1 minute read

```java class Solution { public int minMovesToSeat(int[] seats, int[] students) { int result = 0; int[] sseats = mergeSort(0, seats.lengt...

LeetCode 75.

less than 1 minute read

class Solution { public void sortColors(int[] nums) { //[2,0,2,1,1,0] => [0,0,1,1,2,2] int[] cnt = new int[3]; for (int i=0; i...

Netty Self-taught Diary (2)

1 minute read

ByteBuffer(Java)/ByteBuf(Netty) 先來介紹數據類型ByteBuf,這個ByteBuf類是Netty根據Java的ByteBuffer所演化而來的,兩者都是爲了處理數據而產生。因爲在ChannelHandler中所接收到的數據只能保證順序而沒辦法保證接收...

Netty Self-taught Diary (1)

1 minute read

Intro 本來很久之前就想自己寫一個聊天程式自己用,但是一直苦於Netty官網上艱澀的User Guide