Skip to content

Ayushk1804 Solution#208

Open
ayushk1804 wants to merge 1 commit intosymblai:mainfrom
ayushk1804:patch-1
Open

Ayushk1804 Solution#208
ayushk1804 wants to merge 1 commit intosymblai:mainfrom
ayushk1804:patch-1

Conversation

@ayushk1804
Copy link
Copy Markdown

Approach:

  • Split the string to generate an array of four strings i.e. A, B, C, D.

  • If any one of them contains ?, then for each position, check whether the required number and given number match or not (excluding the ? position).

  • If they match, then return the missing digit in the given number (position of ? in given number).

  • I've completed the given assignment and tested with the given testcases and some extra edge cases. I've added my solution with this PR.

Approach:

Split the string to get an array of four strings i.e. A, B, C, D.
If any one of them contains ?, then for each position check whether the required number and given number match or not (excluding the ? position).
If they match, then return the missing digit in the given number (position of ? in given number).
I've completed the given assignment and tested with the given testcases and some extra edge cases. I've added my solution with this PR.
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