R和Python里得到传入参数的变量名
发表于
更新于
[leetcode 282]Expression Add Operators 原创解法
发表于
更新于
题目概述
Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (
not unary) +, -, or * between the digits so they evaluate to the target value.
"123", 6 -> ["1+2+3", "1*2*3"]
"232", 8 -> ["2*3+2", "2+3*2"]
"105", 5 -> ["1*0+5","10-5"]
"00", 0 -> ["0+0", "0-0", "0*0"]
"3456237490", 9191 -> []
[leetcode 200]Number of Islands 原创解法
发表于
更新于
题目概述
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
11110
11010
11000
00000
Answer: 1
Example 2:
11000
11000
00100
00011
Answer: 3