DKU-STUDY / Algorithm

단국대학교 알고리즘 스터디
https://docs.google.com/spreadsheets/d/12s4bTdAsZyamQS3wMsElsHTh8mrnX0LAkCrL7QmNvlo/edit?usp=sharing
145 stars 35 forks source link

[LeetCode] Number of Steps to Reduce a Number to Zero #992

Closed 12hyeon closed 3 years ago

12hyeon commented 3 years ago

짝수면 /2, 홀수면 -1를 시행해서 0을 만들때까지의 단계를 반환하는 문제

풀이 for문에서 if문을 이용해서 0이 될 때까지의 단계를 계산함 (else 대신 continue를 이용해서 시간을 줄임)