读题

题目难度:medium
题目中涉及到字符串和数字之间的互相转化,而且规定不允许使用java内置的库。
#LeetCode#Problem 43. Multiply Strings-字符串相乘(java版)

思路

使用内置函数转化

先皮一下,用内置函数会是多么简单。代码如下:

class Solution {
   public String multiply(String num1, String num2) {
		int n1 = Integer.parseInt(num1);
		int n2 = Integer.parseInt(num2);
		String resStr = String.valueOf(n1 * n2);
		
		return resStr;
    }
}

恩,然后果然被嫌弃了。。。

#LeetCode#Problem 43. Multiply Strings-字符串相乘(java版)

相关文章:

  • 2021-07-01
  • 2021-10-02
  • 2021-08-24
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
猜你喜欢
  • 2021-06-13
  • 2021-12-09
  • 2021-11-19
  • 2021-11-27
  • 2021-06-06
  • 2021-06-15
相关资源
相似解决方案