Skip to content

Commit 9f9a9f8

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Arrays: Left Rotation. Clean code improvement.
1 parent db4b1a6 commit 9f9a9f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hackerrank/interview_preparation_kit/arrays/ctci_array_left_rotation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import logging
55

66
LOGGER = logging.getLogger(__name__)
7+
FIRST_POSITION: int = 0
78

89

910
def rot_left_one(group: list[int]) -> list[int]:
1011

11-
first = group.pop(0)
12+
first = group.pop(FIRST_POSITION)
1213
group.append(first)
1314

1415
return group

0 commit comments

Comments
 (0)