Comparing version 0.1.30 to 0.1.31
export declare function lengthOfLongestSubstring(s: string): number; | ||
export declare function backspaceCompare(source: string, target: string): boolean; | ||
export declare function strip(str: string): string; | ||
export declare function isPalindrome(str: string): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.backspaceCompare = exports.lengthOfLongestSubstring = void 0; | ||
exports.isPalindrome = exports.strip = exports.backspaceCompare = exports.lengthOfLongestSubstring = void 0; | ||
function lengthOfLongestSubstring(s) { | ||
@@ -58,1 +58,19 @@ if (s.length === 0) { | ||
exports.backspaceCompare = backspaceCompare; | ||
function strip(str) { | ||
return str.replace(/\d+|\s+|[\?,:]+/g, '').toLowerCase(); | ||
} | ||
exports.strip = strip; | ||
function isPalindrome(str) { | ||
var s = strip(str); | ||
var p1 = 0; | ||
var p2 = s.length - 1; | ||
while (p1 < p2) { | ||
if (s[p1] !== s[p2]) { | ||
return false; | ||
} | ||
p1 += 1; | ||
p2 -= 1; | ||
} | ||
return true; | ||
} | ||
exports.isPalindrome = isPalindrome; |
{ | ||
"name": "flex-algo", | ||
"version": "0.1.30", | ||
"version": "0.1.31", | ||
"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
43456
1198