Skip to content

Commit

Permalink
test(iterative_digit_sum.py): modify logic to confirm force re-run works
Browse files Browse the repository at this point in the history
  • Loading branch information
violetbrina committed Dec 13, 2024
1 parent 15f0c4e commit 7efab1c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cpg_flow_test/jobs/iterative_digit_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def iterative_digit_sum(
# Function to calculate the iterative digit sum
iterative_digit_sum() {{
local num=$1
while [ ${{#num}} -gt 1 ]; do
local sum=0
for (( i=0; i<${{#num}}; i++ )); do
sum=$((sum + ${{num:i:1}}))
local num=$1
while [ ${{#num}} -gt 2 ]; do
local sum=0
for (( i=0; i<${{#num}}; i++ )); do
sum=$((sum + ${{num:i:1}}))
done
num=$sum
done
num=$sum
done
echo $num
echo $num
}}
# Extract digits from the alphanumeric string and calculate digit sum
Expand Down

0 comments on commit 7efab1c

Please sign in to comment.