摘要:
Pascal's Triangle IIGiven an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your alg... 阅读全文
摘要:
Pascal's TriangleGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,... 阅读全文
摘要:
House Robber IINote:This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his thi... 阅读全文
摘要:
House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint... 阅读全文
摘要:
Spiral Matrix IIGiven an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the... 阅读全文
摘要:
Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[... 阅读全文
摘要:
Peeking IteratorGiven an Iterator class interface with methods:next()andhasNext(), design and implement a PeekingIterator that support thepeek()operat... 阅读全文