原创 75. Sort Colors

Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are ad

原创 1013. Partition Array Into Three Parts With Equal Sum

Given an array A of integers, return true if and only if we can partition the array into three non-empty parts with e

原创 56. Merge Intervals

Given a collection of intervals, merge all overlapping intervals. 今天做了一道Medium的題,竟然做出來了。 不過在這個過程中我遇到了一些問題: 1、list.rem

原创 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection. 今天做了一道easy題,和之前做的一道很類似,是II版本的,所以不是很費勁的就做出來了。 class

原创 973. K Closest Points to Origin

We have a list of points on the plane. Find the K closest points to the origin (0, 0). (Here, the distance between t

原创 收割百度、阿里、騰訊、頭條、網易華爲等大廠Offer的面經

原文傳送門 本文作者是跨專業考研的985碩士一枚,經歷研究生兩年的學習積累,有幸於2019秋季招聘中拿到幾個公司的研發崗offer,包括百度,阿里,騰訊,今日頭條,網易,華爲等。 一路走來也遇到很多困難,也踩了很多坑,同時他自己也探索

原创 java中object類對象轉換成int對象的兩種方法

1.先把object對象轉換成String,在用Inetger裏的parseInt轉成int Objcet obj; int a= Integer.parseInt(obj.toString()); 2.先把object強轉成Long

原创 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection. 今天,依舊做了一道easy題,是找出兩個數組的交集,並且這個交集不能有重複元素。 不能有重複元素,於是

原创 922. Sort Array By Parity II 976. Largest Perimeter Triangle

今天做了兩道easy題,我專門挑的sort種類的題,都做出來了,比較高興了! 做第二道題的時候,我用了快速排序的方法,快速排序怎麼寫了已經忘了,專門上網看了看,學習了學習,明天需要鞏固! 922. Sort Array By Pari

原创 993. Cousins in Binary Tree

In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a bin

原创 997. Find the Town Judge

In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town j

原创 994. Rotting Oranges

In a given grid, each cell can have one of three values: the value 0 representing an empty cell; the value 1 represen

原创 999. Available Captures for Rook

On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. T

原创 1013. Pairs of Songs With Total Durations Divisible by 60

In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of songs for which th

原创 1012. Complement of Base 10 Integer

Every non-negative integer N has a binary representation. For example, 5 can be represented as “101” in binary, 11 a