-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
@@ -0,0 +1,51 @@ | |||
/* Kotlin code for Longest increasing subsequence/* |
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 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:") |
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.
fix indentation
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 fix indentation here, still not fixed.
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.
you didn't do this change yet
fun main() | ||
{ | ||
var read = Scanner(System.`in`) | ||
println("Enter the size of Array:") |
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 fix indentation here, still not fixed.
@MastersAbh The change you are asking is not visible to me. |
|
||
for (i in 0 until n) | ||
{ | ||
lis[i] = 1; |
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.
correct the indentation
{ | ||
if (arr[i] > arr[j] && lis[i] < lis[j] + 1) | ||
{ | ||
lis[i] = lis[j] + 1; |
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.
correct the indentation
fun main() | ||
{ | ||
var read = Scanner(System.`in`) | ||
println("Enter the size of Array:") |
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.
you didn't do this change yet
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)) |
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.
fix the indentation
Like I mentioned earlier I am unable to see the indentation faults on my screen. |
|
||
fun main() | ||
{ | ||
var read = Scanner(System.`in`) |
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.
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.
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.
Looks good now. Please squash your commits.
Updated LIS
All changes made.
Fixes #2253
Checklist:
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:
Languages Used:
Files Added:
Thanks!