You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is, sums up to n*k where n is also an integer.
10
+
11
+
//Example 1:
12
+
13
+
//Input: [23, 2, 4, 6, 7], k=6
14
+
//Output: True
15
+
//Explanation: Because [2, 4] is a continuous subarray of size 2 and sums up to 6.
16
+
17
+
//Example 2:
18
+
19
+
//Input: [23, 2, 6, 4, 7], k=6
20
+
//Output: True
21
+
//Explanation: Because [23, 2, 6, 4, 7] is an continuous subarray of size 5 and sums up to 42.
22
+
// Note:
23
+
//The length of the array won’t exceed 10,000.
24
+
//You may assume the sum of all the numbers is in the range of a signed 32-bit integer.
// You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night.
10
+
11
+
//Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police.
0 commit comments