Comparing version 0.1.42 to 0.1.43
@@ -7,1 +7,6 @@ export type LongestPalindromeResult = { | ||
export declare function longestPalindrome(s: string): LongestPalindromeResult; | ||
export type MaxSubArrayResult = { | ||
max: number; | ||
maxArray: number[]; | ||
}; | ||
export declare function maxSubArray(nums: number[]): MaxSubArrayResult; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.longestPalindrome = void 0; | ||
exports.maxSubArray = exports.longestPalindrome = void 0; | ||
function longestPalindrome(s) { | ||
@@ -37,1 +37,27 @@ var len = s.length; | ||
exports.longestPalindrome = longestPalindrome; | ||
function maxSubArray(nums) { | ||
var currentArr = [0]; | ||
var maxArr = [0]; | ||
var current = nums[0]; | ||
var max = nums[0]; | ||
for (var i = 1; i < nums.length; i++) { | ||
var num = nums[i]; | ||
if (num + current > num) { | ||
current = num + current; | ||
currentArr.push(i); | ||
} | ||
else { | ||
current = num; | ||
currentArr = [i]; | ||
} | ||
if (current > max) { | ||
max = current; | ||
maxArr = currentArr.map(function (item) { return item; }); | ||
} | ||
} | ||
return { | ||
max: max, | ||
maxArray: maxArr, | ||
}; | ||
} | ||
exports.maxSubArray = maxSubArray; |
@@ -15,3 +15,3 @@ import { PriorityQueue } from './priorityQueue'; | ||
import { LinkedList } from './linkedList'; | ||
import { longestPalindrome } from './dynamicProgramming'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, twoSum, maxArea, isValidParentheses, minRemoveToMakeValid, StackQueue, ValueType, LinkedList, }; | ||
import { longestPalindrome, maxSubArray } from './dynamicProgramming'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, maxSubArray, twoSum, maxArea, isValidParentheses, minRemoveToMakeValid, StackQueue, ValueType, LinkedList, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LinkedList = exports.StackQueue = exports.minRemoveToMakeValid = exports.isValidParentheses = exports.maxArea = exports.twoSum = exports.longestPalindrome = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = exports.lengthOfLongestSubstring = exports.Matrix = exports.Dijkstra = exports.Graph = exports.searchRange = exports.binarySearchRange = exports.binarySearch = exports.quickSelectPivot = exports.quickSelect = exports.pivot = exports.quickSort = exports.BST = exports.BinaryNode = exports.BinaryTree = exports.PriorityQueue = void 0; | ||
exports.LinkedList = exports.StackQueue = exports.minRemoveToMakeValid = exports.isValidParentheses = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.longestPalindrome = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = exports.lengthOfLongestSubstring = exports.Matrix = exports.Dijkstra = exports.Graph = exports.searchRange = exports.binarySearchRange = exports.binarySearch = exports.quickSelectPivot = exports.quickSelect = exports.pivot = exports.quickSort = exports.BST = exports.BinaryNode = exports.BinaryTree = exports.PriorityQueue = void 0; | ||
var priorityQueue_1 = require("./priorityQueue"); | ||
@@ -45,1 +45,2 @@ Object.defineProperty(exports, "PriorityQueue", { enumerable: true, get: function () { return priorityQueue_1.PriorityQueue; } }); | ||
Object.defineProperty(exports, "longestPalindrome", { enumerable: true, get: function () { return dynamicProgramming_1.longestPalindrome; } }); | ||
Object.defineProperty(exports, "maxSubArray", { enumerable: true, get: function () { return dynamicProgramming_1.maxSubArray; } }); |
{ | ||
"name": "flex-algo", | ||
"version": "0.1.42", | ||
"version": "0.1.43", | ||
"description": "\"SDK for commonly used data structure and algorithms\"", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57735
35
1583