-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Added LCS implementation in Ruby (#2252) #2766
Added LCS implementation in Ruby (#2252) #2766
Conversation
Hello @jainaman224 I have implemented LCS algorithm in Ruby. Please review the changes and let me know if I need to add/change something. Thank You |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add sample input and sample output at end of file.
end | ||
|
||
# Driver Code | ||
arr1 = [10, 15, 20, 25, 30, 35, 40] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to take dynamic inputs in Ruby. Please update the code to take dynamic inputs. This requirement is only relaxed for languages like js or php where we have to create forms for dynamic inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have changed to dynamic input
# The longest common subsequence comprises of elements 10, 25, 30, 40 in the above arrays | ||
# Output: | ||
# Length of Longest Common Subsequence is: 4 | ||
puts "Length of Longest Common Subsequence is: #{len}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a blank line at end of file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added blank line
@@ -0,0 +1,40 @@ | |||
# Problem Statement- Given two sequences, find |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please convert these to a single multi line comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted them to a single multi-line comment
28509d2
to
ac37213
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the requested changes and then squash your commits. Rest all looks good.
439e775
to
242aa75
Compare
Fixes #2252
Checklist:
Changes proposed in this pull request:
Languages Used:
Files Added:
Thanks!