摘要:
Problem Description:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1... 阅读全文
摘要:
Problem Description:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your alg... 阅读全文
摘要:
Problem Description:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For ex... 阅读全文
摘要:
Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most... 阅读全文
摘要:
Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit... 阅读全文
摘要:
Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit... 阅读全文
摘要:
Problem Description:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below bina... 阅读全文
摘要:
Problem Description:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a... 阅读全文
摘要:
Problem Description:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Onl... 阅读全文
摘要:
Problem Description:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one l... 阅读全文