Skip to content

feat: add cangjie solution to lc problem: No.0001 #3827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
yanglbme authored Nov 30, 2024
commit 7aa2f339fe3ae50c3567d40a1b33539ab6818c2f
32 changes: 16 additions & 16 deletions solution/0000-0099/0001.Two Sum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,22 @@ class Solution {
}
```

#### Nim

```nim
import std/enumerate
import std/tables

proc twoSum(nums: seq[int], target: int): seq[int] =
var d = initTable[int, int]()
for i, x in nums.pairs():
let y = target - x
if d.hasKey(y):
return @[d[y], i]
d[x] = i
return @[]
```

#### Cangjie

```cj
Expand All @@ -338,22 +354,6 @@ class Solution {
}
```

#### Nim

```nim
import std/enumerate
import std/tables

proc twoSum(nums: seq[int], target: int): seq[int] =
var d = initTable[int, int]()
for i, x in nums.pairs():
let y = target - x
if d.hasKey(y):
return @[d[y], i]
d[x] = i
return @[]
```

<!-- tabs:end -->

<!-- solution:end -->
Expand Down
Loading