mrlonelyjtr's blog

写BUG的程序猿


  • Home

  • Categories

  • Archives

  • Tags

  • Search

[LeetCode] Problem 811 - Subdomain Visit Count

Posted on 2019-08-10 | In Algorithm , LeetCode
A website domain like “discuss.leetcode.com” consists of various subdomains. At the top level, we have “com”, at the next level, we have “leetcode.com ...
Read more »

[LeetCode] Problem 401 - Binary Watch

Posted on 2019-08-09 | In Algorithm , LeetCode
A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents ...
Read more »

[LeetCode] Problem 392 - Is Subsequence

Posted on 2019-08-09 | In Algorithm , LeetCode
Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is po ...
Read more »

[LeetCode] Problem 383 - Ransom Note

Posted on 2019-08-09 | In Algorithm , LeetCode
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans ...
Read more »

[LeetCode] Problem 371 - Sum of Two Integers

Posted on 2019-08-09 | In Algorithm , LeetCode
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. ExampleNo.1Input: a = 1, b = 2 Output: 3 No.2Input: a ...
Read more »

【图解设计模式】Chain of Responsibility模式

Posted on 2019-08-09 | In Design Pattern
将多个对象组成一条职责链,然后按照它们在职责链上的顺序一个一个地找出到底应该谁来负责处理。 示例当一个人被要求做什么事情时,如果他可以做就自己做,如果不能做就将“要求”转给另外一个人。下一个人如果可以自己处理,就自己做;如果也不能自己处理,就再转给另外一个人… 类图 时序图 Trouble类1234 ...
Read more »

【图解设计模式】Visitor模式

Posted on 2019-08-09 | In Design Pattern
数据结构与处理被分离开来。表示“访问者”的类来访问数据结构中的元素,并把对各元素的处理交给访问者类。 示例用文件和文件夹的例子作为访问者要访问的数据结构。访问者会访问由文件和文件夹构成的数据结构,然后显示出文件和文件夹的一览。 类图 时序图 Visitor类1234public abstract c ...
Read more »

java.io包与Decorator模式

Posted on 2019-08-09 | In Design Pattern
java.io包是用于输入输出(I/O)的包。这里,使用了Decorator模式。 首先,可以像下面这样生成一个读取文件的实例。 1Reader reader = new FileReader("datafile.txt"); 然后,也可以像下面这样在读取文件时将文件内容放入缓冲区。 12Read ...
Read more »

[LeetCode] Problem 784 - Letter Case Permutation

Posted on 2019-08-08 | In Algorithm , LeetCode
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible str ...
Read more »

【图解设计模式】Decorator模式

Posted on 2019-08-08 | In Design Pattern
不断地为对象添加装饰。 示例给文字添加装饰边框。 类图 Display类12345678910public abstract class Display { public abstract int getColumns(); public abstract int getRow ...
Read more »
1…252627…78
mrlonelyjtr

mrlonelyjtr

间歇性踌躇满志,持续性混吃等死

780 posts
18 categories
18 tags
Github
© 2020 mrlonelyjtr
Powered by Hexo
Theme - NexT.Pisces