Skip to content

Commit a20b87b

Browse files
refactor 365
1 parent 8dd97d1 commit a20b87b

File tree

1 file changed

+0
-24
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-24
lines changed

src/main/java/com/fishercoder/solutions/_365.java

-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 365. Water and Jug Problem
5-
*
6-
* You are given two jugs with capacities x and y litres.
7-
* There is an infinite amount of water supply available.
8-
* You need to determine whether it is possible to measure exactly z litres using these two jugs.
9-
*
10-
If z liters of water is measurable, you must have z liters of water contained within one or both buckets by the end.
11-
12-
Operations allowed:
13-
14-
Fill any of the jugs completely with water.
15-
Empty any of the jugs.
16-
Pour water from one jug into another till the other jug is completely full or the first jug itself is empty.
17-
18-
Example 1: (From the famous "Die Hard" example)
19-
Input: x = 3, y = 5, z = 4
20-
Output: True
21-
22-
Example 2:
23-
Input: x = 2, y = 6, z = 5
24-
Output: False
25-
26-
*/
273
public class _365 {
284

295
public static class Solution1 {

0 commit comments

Comments
 (0)