This question on LeetCode is a great practice for warm-ups. The approach I used was to count the consecutive occurrences of A
and B
excluding the ones at the beginning and end of the sequence. However, we can also use the Regular Expression to check who will win the game.
Intellij 單行註解調整
我們想設定讓 Intellij 的註解可以起始在目前程式當前空格的地方,而不是在首行,可以這樣設定
1658. Minimum Operations to Reduce X to Zero
219. Contains Duplicate II
Which collections classes are thread-safe in Java
Currently, I've been preparing for interview questions related to Java, and I find thread-safe Collections classes quite interesting. This is because I encountered a similar question related to Collections in a previous job interview. I would say that Collections is one of the most popular topics that interviewers like to ask about.