随笔分类 -  array (prefix)

523. Continuous Subarray Sum ( if the array has a continuous subarray of size at least 2 that sums up to the multiple of k or k )
摘要:(找到连续的 subarray 和等于 k (不需要 k 的倍数) https://github.com/tongzhang1994/Facebook-Interview-Coding/blob/master/Subarray%20Sum.java Given a list of non-negat 阅读全文

posted @ 2018-07-18 09:05 猪猪🐷

525. Contiguous Array
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0 阅读全文

posted @ 2018-07-18 09:04 猪猪🐷

325. Maximum Size Subarray Sum Equals k (maximum length of a subarray that sums to k.)
摘要:Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Note:The sum of 阅读全文

posted @ 2018-07-18 09:02 猪猪🐷

560. Subarray Sum Equals K ( find the total number of continuous subarrays whose sum equals to k.)
摘要:练习把start 和end 的index打印出来。。 类似LC560,还要简单,只需要返回true/false就行。follow up: overflow如何解决 Given an array of integers and an integer k, you need to find the to 阅读全文

posted @ 2018-07-18 09:01 猪猪🐷

303. Range Sum Query - Immutable
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: 阅读全文

posted @ 2018-07-18 08:59 猪猪🐷

导航