An open API service indexing awesome lists of open source software.

https://github.com/jaytwolab/water-jug-solver

Measuring 4 Liters: A Classic Water Jug Riddle :kr: 4리터 측정하기: 고전적인 물병 수수께끼
https://github.com/jaytwolab/water-jug-solver

Last synced: about 1 year ago
JSON representation

Measuring 4 Liters: A Classic Water Jug Riddle :kr: 4리터 측정하기: 고전적인 물병 수수께끼

Awesome Lists containing this project

README

          

# 4리터 측정하기: 고전적인 물병 수수께끼

> [English](README.md) , [Korean](README.ko.md)

## 수수께끼

- 두 개의 물병이 있습니다:
- 5리터 물병과 3리터 물병.
- 이 두 물병을 사용해 정확히 4리터의 물을 만들려면 어떻게 해야 할까요?

## 알고리즘
- 각 물병의 현재 상태(물의 양)를 정의합니다.
- 가능한 물 붓기 동작(채우기, 비우기, 물 붓기)을 시뮬레이션합니다.
- 상태를 반복하지 않도록 방문한 상태를 저장합니다.
- 목표 상태(한 병에 정확히 4리터)를 찾으면 종료합니다.

## 코드

- [water-problem.py](water-problem.py)

## 블로그
- https://j2doll.tistory.com/1066