Search results
Pascal's Triangle - Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: [https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif] Example 1: Input: numRows = 5 Output: [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6 ...
Easy. Given an integer rowIndex, return the rowIndex th (0-indexed) row of the Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: Example 1: Input: rowIndex = 3. Output: [1,3,3,1] Example 2: Input: rowIndex = 0.
Easy. Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: Example 1: Input: numRows = 5. Output: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]] Example 2: Input: numRows = 1. Output: [[1]]
Contest - LeetCode. Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
View krishna_118's profile on LeetCode, the world's largest programming community.
Boost your coding interview skills and confidence by practicing real interview questions with LeetCode. Our platform offers a range of essential problems for practice, as well as the latest questions being asked by top-tier companies.
We now support 14 popular coding languages. At our core, LeetCode is about developers. Our powerful development tools such as Playground help you test, debug and even write your own projects online. At LeetCode, our mission is to help you improve yourself and land your dream job.
Triangle - LeetCode. Can you solve this real interview question? Triangle - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example 1: Input: nums = [100,4,200,1,3,2] Output: 4. Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.
Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a container can store. Notice that you may not slant the container. Example 1: Input: height = [1,8,6,2,5,4,8,3,7] Output: 49.