題目Given an array A of positive integers, call a (contiguous, not necessarily distinct) ...
題目Given an array A of positive integers, call a (contiguous, not necessarily distinct) ...
找所有 local maximum,array 滿足兩個(gè)條件|a[i] - a[i-1]| = 1 The local maxima are sparseE.g. 1 2 3...
題目This question is about implementing a basic elimination algorithm for Candy Crush. Gi...
題目You are playing the following Flip Game with your friend: Given a string that contain...
題目Given two integers representing the numerator and denominator of a fraction, return t...
題目In a row of seats, 1 represents a person sitting in that seat, and 0 represents that ...
題目Given an integer array of size n, find all elements that appear more than ? n/3 ? tim...
題目Given an array of size n, find the majority element. The majority element is the elem...
題目We have an array A of non-negative integers. For every (contiguous) subarray B = [A[i...
題目Median is the middle value in an ordered integer list. If the size of the list is eve...
題目略 答案 這題能不能用類似Serialize and Deserialize Binary Tree的方法呢?即, 每當(dāng)遇到一個(gè)子樹的child為null時(shí),插入一個(gè)#。...
題目Given n books and the ith book has A[i] pages. You are given k people to copy the n b...
題目Given two strings, find the longest common substring. Return the length of it. Exampl...
題目Given two sequence P and Q of numbers. The task is to find Longest Common Subsequence...