Skip to content

Commit 2365f66

Browse files
committed
newProblem: 获取所有题目代码片段(模板)
close #915 Signed-off-by: LetMeFly666 <[email protected]>
1 parent d9db126 commit 2365f66

File tree

64,116 files changed

+420150
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64,116 files changed

+420150
-82
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution(object):
2+
def twoSum(self, nums, target):
3+
"""
4+
:type nums: List[int]
5+
:type target: int
6+
:rtype: List[int]
7+
"""
8+

AllProblems/1.两数之和/code.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Note: The returned array must be malloced, assume caller calls free().
3+
*/
4+
int* twoSum(int* nums, int numsSize, int target, int* returnSize) {
5+
6+
}

AllProblems/1.两数之和/code.cj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution {
2+
func twoSum(nums: Array<Int64>, target: Int64): Array<Int64> {
3+
4+
}
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public:
3+
vector<int> twoSum(vector<int>& nums, int target) {
4+
5+
}
6+
};

AllProblems/1.两数之和/code.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Solution {
2+
public int[] TwoSum(int[] nums, int target) {
3+
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution {
2+
List<int> twoSum(List<int> nums, int target) {
3+
4+
}
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-spec two_sum(Nums :: [integer()], Target :: integer()) -> [integer()].
2+
two_sum(Nums, Target) ->
3+
.

AllProblems/1.两数之和/code.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
defmodule Solution do
2+
@spec two_sum(nums :: [integer], target :: integer) :: [integer]
3+
def two_sum(nums, target) do
4+
5+
end
6+
end

AllProblems/1.两数之和/code.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func twoSum(nums []int, target int) []int {
2+
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution {
2+
public int[] twoSum(int[] nums, int target) {
3+
4+
}
5+
}

0 commit comments

Comments
 (0)