Skip to content

Commit d39b19e

Browse files
refactor 640
1 parent e0fce4b commit d39b19e

File tree

1 file changed

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

1 file changed

+0
-33
lines changed

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 640. Solve the Equation
5-
*
6-
* Solve a given equation and return the value of x in the form of string "x=#value".
7-
* The equation contains only '+', '-' operation, the variable x and its coefficient.
8-
9-
If there is no solution for the equation, return "No solution".
10-
11-
If there are infinite solutions for the equation, return "Infinite solutions".
12-
13-
If there is exactly one solution for the equation, we ensure that the value of x is an integer.
14-
15-
Example 1:
16-
Input: "x+5-3+x=6+x-2"
17-
Output: "x=2"
18-
19-
Example 2:
20-
Input: "x=x"
21-
Output: "Infinite solutions"
22-
23-
Example 3:
24-
Input: "2x=x"
25-
Output: "x=0"
26-
27-
Example 4:
28-
Input: "2x+3x-6x=x+2"
29-
Output: "x=-1"
30-
31-
Example 5:
32-
Input: "x=x+2"
33-
Output: "No solution"
34-
35-
*/
363
public class _640 {
374
public static class Solution1 {
385
/**

0 commit comments

Comments
 (0)