Author: amethlex

0002505492

Snap面经题目: Word Combinations

题目一个INPUT STRING ARRAY1 比如CAT, DOG,一个INPUT STRING...阅读全文 Read More
work-in-chuang-bian-de-xiao-dou-dou-1-mask9

The difference Between String.replace() and String.replaceAll()

摘自java8 doc
String replace(char oldChar, char newC...
阅读全文 Read More
0002505492

Snap面经题目:IP Filter

题目提供一些ip mask和一个ip address 寻找 最长的匹配。思路显然是Trie。代码...阅读全文 Read More
illust_global05

Primitive Data Types of Java

byteThe byte data type is a-bit signed two's co...阅读全文 Read More
0002505492

Snap面经题目: filter dictionary

题目public Lissolution (char[] array, Lisdic) {输...阅读全文 Read More
work-in-chuang-bian-de-xiao-dou-dou-1-mask9

Leetcode 133. Clone Graph

题目Clone an undirected graph. Each node in the gra...阅读全文 Read More
0002505492

Snap面经题目:count number of the same subtrees

题目
给一个树的root node,返回same subtree及个数:给一个树的root node,返回same subtree及个数:/*10/        \8                3./  \            /     \4    5        8           5/       /   \        /3       4     5      3./.3Expects:8/ \4   5      Count: 2/35./         Count: 3.3*/
思路使用postorder traverse,注意null节点返回“*”代码
import java.util.*;class TreeNode{public TreeNode left, right;public String  val;public TreeNode(String val){this.val = val;}}public class Solution {public static TreeNode buildTree(String[] input){int index = 0;TreeNode root = new TreeNode(input[index++]);Queuequeue = new LinkedLis...
阅读全文 Read More
0002505492

Snap面经题目: 可能路径

题目描述给一个board(n * n), 然后给一个m,m = 至多能过当前点的次数。返回任意起点...阅读全文 Read More