programmers level1 알고리즘 문제 - 하샤드 수

먼저, 문제부터!



내가 푼 코드 :


숫자 x를 String으로 형변환하면서 자릿수로 split한 다음,
sum이라는 변수에 모두 누적시킨 후,
숫자 x를 sum으로 나누었을 때 나머지가 0인 경우를 하샤드 수
아닌 경우를 하샤드 수가 아니라고 리턴하도록 코드를 짜보았다.

댓글

이 블로그의 인기 게시물

About Kafka Basic

About JVM Warm up

About ZGC

Spring Boot Actuator readiness, liveness probes on k8s

About G1 GC

sneak peek jitpack

About idempotent

C 언어 구조체의 포인터 멤버 변수

Synology NAS에 MariaDB 10에 Mysql workbench로 원격접속하기

About Websocket minimize data size and data transfer cost on cloud