给出4个1-10的数字,通过加减乘除,得到数字为24就算胜利。
示例1
输入
[7,2,1,10]
输出
true
说明
7*2+1*10
加载中...
import java.util.*; public class Solution { /** * * @param arr int整型一维数组 * @return bool布尔型 */ public boolean Game24Points (int[] arr) { // write code here } }
class Solution { public: /** * * @param arr int整型一维数组 * @param arrLen int arr数组长度 * @return bool布尔型 */ bool Game24Points(int* arr, int arrLen) { // write code here } };
# # # @param arr int整型一维数组 # @return bool布尔型 # class Solution: def Game24Points(self , arr ): # write code here
/** * * @param arr int整型一维数组 * @return bool布尔型 */ function Game24Points( arr ) { // write code here } module.exports = { Game24Points : Game24Points };
# # # @param arr int整型一维数组 # @return bool布尔型 # class Solution: def Game24Points(self , arr ): # write code here
package main /** * * @param arr int整型一维数组 * @return bool布尔型 */ func Game24Points( arr []int ) bool { // write code here }
/** * * @param arr int整型一维数组 * @param arrLen int arr数组长度 * @return bool布尔型 */ bool Game24Points(int* arr, int arrLen ) { // write code here }
[7,2,1,10]
true