Mister-Hope

43. Multiply StringsMister-HopeJavaScriptTypeScript

JavaScript

simple

/*
 * Runtime: 88 ms, faster than 89.78% of JavaScript online submissions for Multiply Strings.
 *
 * Memory Usage: 38.6 MB, less than 5.35% of JavaScript online submissions for Multiply Strings.
 */

const multiply = (num1, num2) => (BigInt(num1) * BigInt(num2)).toString();

TypeScript

smiple

/*
 * Runtime: 96 ms, faster than 95.45% of TypeScript online submissions for Multiply Strings.
 *
 * Memory Usage: 40.3 MB, less than 9.09% of TypeScript online submissions for Multiply Strings.
 */

const multiply = (num1: string, num2: string): string =>
  (BigInt(num1) * BigInt(num2)).toString();