Comparing version 0.1.58 to 0.1.59
@@ -9,3 +9,3 @@ import { PriorityQueue } from './priorityQueue'; | ||
import { Matrix } from './matrix'; | ||
import { lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, hash, groupAnagrams, multiply } from './string'; | ||
import { lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, hash, groupAnagrams, multiply, romanToInt } from './string'; | ||
import { twoSum, maxArea, moveZeroes, findDuplicate, maxProfit } from './array'; | ||
@@ -18,2 +18,2 @@ import { isValidParentheses, minRemoveToMakeValid, isValidParenthesisV2, longestValidParentheses } from './stack'; | ||
import { mergeSortedArray, searchRotatedSortedArray } from './sort'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, hash, groupAnagrams, multiply, maxSubArray, twoSum, maxArea, moveZeroes, findDuplicate, maxProfit, isValidParentheses, isValidParenthesisV2, minRemoveToMakeValid, longestValidParentheses, StackQueue, ValueType, LinkedList, addTwoNumbers, removeNthFromEnd, ListNode, traverseLinkedList, mergeSortedArray, searchRotatedSortedArray, }; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, hash, groupAnagrams, multiply, romanToInt, maxSubArray, twoSum, maxArea, moveZeroes, findDuplicate, maxProfit, isValidParentheses, isValidParenthesisV2, minRemoveToMakeValid, longestValidParentheses, StackQueue, ValueType, LinkedList, addTwoNumbers, removeNthFromEnd, ListNode, traverseLinkedList, mergeSortedArray, searchRotatedSortedArray, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.searchRotatedSortedArray = exports.mergeSortedArray = exports.traverseLinkedList = exports.ListNode = exports.removeNthFromEnd = exports.addTwoNumbers = exports.LinkedList = exports.StackQueue = exports.longestValidParentheses = exports.minRemoveToMakeValid = exports.isValidParenthesisV2 = exports.isValidParentheses = exports.maxProfit = exports.findDuplicate = exports.moveZeroes = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.multiply = exports.groupAnagrams = exports.hash = 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.searchRotatedSortedArray = exports.mergeSortedArray = exports.traverseLinkedList = exports.ListNode = exports.removeNthFromEnd = exports.addTwoNumbers = exports.LinkedList = exports.StackQueue = exports.longestValidParentheses = exports.minRemoveToMakeValid = exports.isValidParenthesisV2 = exports.isValidParentheses = exports.maxProfit = exports.findDuplicate = exports.moveZeroes = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.romanToInt = exports.multiply = exports.groupAnagrams = exports.hash = 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"); | ||
@@ -36,2 +36,3 @@ Object.defineProperty(exports, "PriorityQueue", { enumerable: true, get: function () { return priorityQueue_1.PriorityQueue; } }); | ||
Object.defineProperty(exports, "multiply", { enumerable: true, get: function () { return string_1.multiply; } }); | ||
Object.defineProperty(exports, "romanToInt", { enumerable: true, get: function () { return string_1.romanToInt; } }); | ||
var array_1 = require("./array"); | ||
@@ -38,0 +39,0 @@ Object.defineProperty(exports, "twoSum", { enumerable: true, get: function () { return array_1.twoSum; } }); |
@@ -13,1 +13,2 @@ export declare function lengthOfLongestSubstring(s: string): number; | ||
export declare function multiply(num1: string, num2: string): string; | ||
export declare function romanToInt(s: string): number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.multiply = exports.groupAnagrams = exports.hash = exports.isSubPalindrome = exports.isPalindrome = exports.strip = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = exports.lengthOfLongestSubstring = void 0; | ||
exports.romanToInt = exports.multiply = exports.groupAnagrams = exports.hash = exports.isSubPalindrome = exports.isPalindrome = exports.strip = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = exports.lengthOfLongestSubstring = void 0; | ||
function lengthOfLongestSubstring(s) { | ||
@@ -225,1 +225,24 @@ if (s.length === 0) { | ||
exports.multiply = multiply; | ||
function romanToInt(s) { | ||
var roman = { | ||
I: 1, | ||
V: 5, | ||
X: 10, | ||
L: 50, | ||
C: 100, | ||
D: 500, | ||
M: 1000, | ||
}; | ||
var sum = 0; | ||
for (var i = 0; i < s.length; i++) { | ||
sum += roman[s[i]]; | ||
if (i > 0 && | ||
(((s[i] === 'V' || s[i] === 'X') && s[i - 1] === 'I') || | ||
((s[i] === 'L' || s[i] === 'C') && s[i - 1] === 'X') || | ||
((s[i] === 'D' || s[i] === 'M') && s[i - 1] === 'C'))) { | ||
sum -= 2 * roman[s[i - 1]]; | ||
} | ||
} | ||
return sum; | ||
} | ||
exports.romanToInt = romanToInt; |
{ | ||
"name": "flex-algo", | ||
"version": "0.1.58", | ||
"version": "0.1.59", | ||
"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
76892
2104