Skip to content

Longest_Increasing_Subsequence #2935

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

Merged
merged 1 commit into from
May 31, 2020
Merged

Conversation

sandhyabhan
Copy link
Contributor

Fixes #2253

Checklist:

  • 4 space indentation.
  • Coding conventions are followed.
  • Input is taken dynamically.
  • Sample Input / Output is added at the end of file.
  • Logic Documentation (Comments).
  • File names are correct.

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

Changes proposed in this pull request:

  • Add LIS in Kotlin

Languages Used:

  • Kotlin

Files Added:

  • LongestIncreasingSubsequence.kt

We're happy to help you get this ready -- don't be afraid to ask for help.

Thanks!

@@ -0,0 +1,51 @@
/* Kotlin code for Longest increasing subsequence/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please close the comment by proper tag / and not / ..
your entire code seems commented out.

fun main()
{
var read = Scanner(System.`in`)
println("Enter the size of Array:")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indentation here, still not fixed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't do this change yet

fun main()
{
var read = Scanner(System.`in`)
println("Enter the size of Array:")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indentation here, still not fixed.

@sandhyabhan
Copy link
Contributor Author

@MastersAbh The change you are asking is not visible to me.
I tried using a different code editor too.

asha15
asha15 previously requested changes May 30, 2020

for (i in 0 until n)
{
lis[i] = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct the indentation

{
if (arr[i] > arr[j] && lis[i] < lis[j] + 1)
{
lis[i] = lis[j] + 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct the indentation

fun main()
{
var read = Scanner(System.`in`)
println("Enter the size of Array:")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't do this change yet

Comment on lines 33 to 43
val arrSize = read.nextLine().toInt()
var arr = IntArray(arrSize)
println("Enter elements")

for(i in 0 until arrSize)
{
arr[i] = read.nextLine().toInt()
}

int n = arrSize;
println("\nLength of the Longest Increasing Subsequence : " + lis(arr, n))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the indentation

@sandhyabhan
Copy link
Contributor Author

Like I mentioned earlier I am unable to see the indentation faults on my screen.
I tried changing the code editor too.


fun main()
{
var read = Scanner(System.`in`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation in these lines is still not fixed. The easiest solution for you would be to copy your entire code, open the Hackerrank editor for Kotlin under any problem there and paste it there. Again copy+paste from there back to Github. It will solve the issue.

Copy link
Collaborator

@singh-shreya6 singh-shreya6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. Please squash your commits.

@singh-shreya6 singh-shreya6 dismissed stale reviews from asha15 and MastersAbh May 31, 2020 13:05

All changes made.

@singh-shreya6 singh-shreya6 merged commit 5de74e2 into jainaman224:master May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Longest Increasing Subsequence
4 participants