マツシタのお勉強

2017-02-07から1日間の記事一覧

Find All Anagrams in a String: Amazon

Problem Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s. Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100. The order of outp…

Count Path Sum in Binary Tree

Problem You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need to start or end at the root or a leaf, but it must go downwards (traveling only fr…

LRU Cache

Problem leetcode.com Solution This problem can be solved by Double Linked List and HashMap. Source Code