Skip to content

Instantly share code, notes, and snippets.

View tatumalenko's full-sized avatar
👋

Tatum Alenko tatumalenko

👋
View GitHub Profile
Kotlin 12 hrs 17 mins █████████████████▎░░░ 82.2%
TypeScript 2 hrs 3 mins ██▉░░░░░░░░░░░░░░░░░░ 13.7%
Properties 33 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.8%
Git Config 2 mins ░░░░░░░░░░░░░░░░░░░░░ 0.3%
Java 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.0%
.0001e1
0
1
123456
01
01234
.0
.00
.01
.1
@tatumalenko
tatumalenko / maxSubarrayProduct.cpp
Last active July 5, 2019 01:25
https://leetcode.com/problems/maximum-product-subarray/ Given an integer array `nums`, find the contiguous subarray within an array (containing at least one number) which has the largest product. **Example 1:** ``` Input: [2,3,-2,4] Output: 6 Expl
#include <algorithm>
using namespace std;
class Solution {
public:
int maxProduct(vector<int>& nums) {
int len = nums.size();
int maxhere = nums.at(0);
int minhere = nums.at(0); // Needed in case lowest number becomes largest
// from negative number multiplication
body {
font-family: cordova, Verdana, Geneva, Tahoma, sans-serif;
font-size: 14px;
line-height: 1.6;
background-color: white;
padding: 20px;
color: #333;
}
body, body * {
body {
background: white;
}
img {
display: block;
text-align: center;
}
.vscode-body {