Skip to content

Commit 842844b

Browse files
committed
Adding solution
1 parent 3318429 commit 842844b

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

leetcode/1108_defanging_ip_address.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://leetcode.com/problems/defanging-an-ip-address/
2+
3+
class Solution:
4+
def defangIPaddr(self, address: str) -> str:
5+
return address.replace(".", "[.]")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://leetcode.com/problems/build-array-from-permutation/
2+
3+
from typing import List
4+
5+
class Solution:
6+
def buildArray(self, nums: List[int]) -> List[int]:
7+
return [nums[nums[i]] for i in range(len(nums))]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://leetcode.com/problems/concatenation-of-array/
2+
3+
from typing import List
4+
5+
class Solution:
6+
def getConcatenation(self, nums: List[int]) -> List[int]:
7+
return nums + nums

leetcode/2235_add_two_integers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://leetcode.com/problems/add-two-integers/
2+
3+
class Solution:
4+
def sum(self, num1: int, num2: int) -> int:
5+
return num1 + num2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://leetcode.com/problems/convert-the-temperature/
2+
3+
from typing import List
4+
5+
class Solution:
6+
def convertTemperature(self, celsius: float) -> List[float]:
7+
return [celsius + 273.15, celsius * 1.80 + 32.00]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy