More Advanced Programming Questions
More Advanced Programming Questions
Given a 2D grid map of '1's (land) and '0's (water), count the number of islands. An island is
Example:
Output: 3
Given an array of integers nums and an integer k, find the total number of continuous subarrays
Example:
Output: 2
Given an integer array nums, find the contiguous subarray (containing at least one number) which
Example:
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of
the same color are adjacent, with the colors in the order red, white, and blue. (Use integers 0, 1, and
Example:
Input: nums = [2,0,2,1,1,0]
Output: [0,0,1,1,2,2]
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
Example:
Output: [['eat','tea','ate'],['tan','nat'],['bat']]
Example:
Output: [1,2,3,6,9,8,7,4,5]
Given an integer array nums, return the length of the longest strictly increasing subsequence.
Example:
You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2
steps. Find how many distinct ways you can climb to the top.
Example:
Input: n = 3
Example:
Output: 2
There are numCourses courses you have to take, labeled from 0 to numCourses - 1. Some courses
have prerequisites. Given prerequisites as an array of pairs, determine if you can finish all courses.
Example: