Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flex-algo

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flex-algo - npm Package Compare versions

Comparing version 0.1.42 to 0.1.43

LICENSE.md

5

lib/dynamicProgramming.d.ts

@@ -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;

28

lib/dynamicProgramming.js
"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;

4

lib/index.d.ts

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc