Skip to content

Commit 6c7f675

Browse files
committed
update docker-compose cold.py
1 parent bdae6aa commit 6c7f675

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

demo-assignments/A1-OOP/cold/cold.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
https://open.kattis.com/problems/cold
66
"""
77

8+
# for Python 3.7 - 3.9 compatibility for type hinting of class methods
89
from __future__ import annotations
910

1011
__author__ = "Ram Basnet"
@@ -20,7 +21,7 @@
2021

2122

2223
class Solution():
23-
""" Solution class to solve the problem using Singleton pattern"""
24+
""" Solution class to solve the problem using Singleton pattern. """
2425

2526
_instance: "Solution" | None = None
2627

@@ -37,7 +38,7 @@ def __new__(cls) -> "Solution":
3738
return cls._instance
3839

3940
def __init__(self) -> None:
40-
""" Constructor
41+
""" Constructor.
4142
"""
4243
self._n: int = 0 # number of temperatures
4344
self._data: str = '' # data
@@ -61,15 +62,14 @@ def read_data(self, source: Any) -> None:
6162
Args:
6263
source (Any): stdin typically for kattis problem
6364
"""
64-
# ignore the first line
6565
data = source.readlines()
6666
self._n = int(data[0])
6767
self._data = data[1].strip()
6868
self._temps = [Temperature(int(i)) for i in self._data.split()]
6969

7070
@property
7171
def n(self) -> int:
72-
"""Returns the number of temperature readings
72+
""" Returns the number of temperature readings.
7373
7474
Returns:
7575
int: number of temperature readings
@@ -78,7 +78,7 @@ def n(self) -> int:
7878

7979
@property
8080
def data(self) -> str:
81-
""" Returns the data
81+
""" Returns the data.
8282
8383
Returns:
8484
str: data
@@ -90,7 +90,6 @@ def solve(self, source: Any) -> None:
9090
"""
9191
self.read_data(source)
9292
print(self.find_answer())
93-
# sys.stdout.write('1')
9493

9594
@staticmethod
9695
def main() -> None:

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ services:
2020
privileged: true # Grant full privileges to the container
2121
ports:
2222
- 8888:8888
23-
command:
24-
["sh", "-c", "sudo chown user --recursive /home/user; tail -f /dev/null"]
23+
command: ["sh", "-c", "tail -f /dev/null"]
2524

2625
networks:
2726
default:

0 commit comments

Comments
 (0)