Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Added solution for the assignment #173

Closed
wants to merge 2 commits into from
Closed

Feat: Added solution for the assignment #173

wants to merge 2 commits into from

Conversation

akshathkaushal
Copy link

Problem Statement

Given an input equation of the form A * B + C = D, with one of A, B, C, D containing a '?'. Find the value (integer) of '?' (-1 if no value can be found).

Approach

  • Separate the values A, B, C, D
  • Check for the '?' in each
  • Appropriately solve the equation and find the missing number
  • Compare the result with the given number and determine the value of '?'
  • Insert conditions to check if the value of '?' can be defined or not
  • If not, return -1

System requirements

  • Node JS
  • Code editor (optional)

Testing

Run using the command node Solution.js

Output (sample test cases)

image

This PR solves #172


@akshathkaushal akshathkaushal closed this by deleting the head repository Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant