Yesterday my colleague asked me for help...She has two android phones , one is hTC and the other is samsung. One day she changed the pattern lock and later she forgot...she tried all possible combination but in vain.. I check her phones and find them…
给一个datastream和一个fixed window size, 让我design一个class可以完成add number还有find average in the window. 就是不能用vector得用array. 当然用queue是最好的 package DataStreamAverage; import java.util.*; public class Solution { int count; int sum; Queue<Integer> q; public Soluti…
第二题 算法 给你一个arr 返回 T 或者 F arr的每个数代表从这个点开始跳几部,返回T的情况:从这个arr中任意一个数开始跳,可以在每个元素都跳到且只跳到一次的情况下返回到开始跳的元素 比如[1,1,1,1,1,1] => T [0,1,1,1,1,1]=> F [7, 5, 2, 3] => F [2,2,3,1] => T. From 1poi scan array once, get the index that can be reached by each arra…
Given a sorting order string, sort the input string based on the given sorting order string. Ex sorting order string -> dfbcae Input string -> abcdeeabc output -> dbbccaaee 法一:Comparable sample Input: String order = "dfbcae"; String str…