I am solving the well known problem Remove Nth Node From End of List: Given a linked list, remove the n-th node from the end of list and return its head. Example: Given: 1->2->3->4->5, and n = 2
Return: 1->2->3->5.
This is my solution:
public ListNode removeNthFromEnd(ListNode head, i...

I might need to go back to the drawing board completely on this @rolfl, right now there does not seem to be any way I can test the full graph, nor ensure that the algorithms will return in a moderate time (10 seconds max)

I see a comparison of red apples to green apples and you see a comparison of red apples to yellow bananas

the user could have meant for a follow up with a question in the content of the question asking about the ability to unit test. but they didn't give us any textual content

yes the title is completely different from what it was, but it is logical when looking at what little the OP wrote based off their last question, or the question that it's supposed to be a duplicate of

I don't really care, and it shouldn't bother me, it's one question where the code has already been reviewed twice, and no one wants to review the code again, so it was closed and now deleted.

@Malachi - the bigger problem I see here, is that your edits have take a clear question, and made it uncertain, and this confusion happens when old things get dredged up, and the most interested people are not around to answer questions.

@rolfl The biggest issue with the whole problem is that a naive check (without using alternatives) is O(n), where n = length of sequence to check; However if you want to restrict it to two alternatives it gets O(n^2) already, and then it goes out of hand

It depends on n though, but how would I figure out what n would be at maximum allowed with two alternatives?

@rolfl I wasn't meaning that I knew what the user was going to say, I meant I don't care anymore and we will see if the user cares or not and what they meant, or if they are going to fix the question and vote to undelete or write a new question.

@rolfl like you have said, there are things that I can do and then I must wait for nature to takes its course, whatever that may be. I have edited (right or wrong its done), and I voted to reopen and I voted to undelete (which I can't take back). so what more would you have me do, should I flag it so that it can be declined, I know where you stand on the issue, that I should leave things be and let smarter more qualified people handle this sort of thing, so that is what I am doing.

@Malachi Malachi, you have 'championed' this question, going against the community consensus at each point. You obviously feel strongly about it, and I have spent.... a half hour or so in total trying to see it from different angles, and to see what I am missing, and talk about it. Now you are saying that you have stirred up a bunch of stuff, and are going to walk away ...

there is nothing more for me to say. I did what I thought should be done and then let the community have it's way with the question overnight and it's dead deleted, if 2 more people want to undelete it, then there is the issue of reopening and then an answer to the question. you have given me options and advice for the future, and I have heard them and will not stir the pot more on this question.

Is it okay to slot maximum t seconds for an algorithm and kill it after that? Assuming that every sub step takes like 10ms, and every substep is an attempt to improve the result of the previous substep.

I would like to see how would you write this code for best practices, it will help me to learn from you
this is my jquery code i use on scroll event to addClass and animate div element
$(document).on("scroll", function() {
var about = $(".media-about"),
info = $(".media-info"),
...

First, here is the full challenge description:
Watson gives to Sherlock an array: \$A_1, A_2, ..., A_N\$. He also gives to
Sherlock two other arrays: \$B_1, B_2, ..., B_M\$ and \$C_1, C_2, ..., C_M\$.
Then Watson asks Sherlock to perform the following program:
for i = 1 to M do
fo...

I call the SList class an Abstract Data Type because it satisfies following 6 invariants:
Multiple users of SList class should be consistent in usage with same SList instance. For example multiple users may insert items in same shopping list.
No runtime exceptions while using SList class when ...

HOW IZ I VALIDATEMOOV YR MOOV
ANY OF ...
BOTH SAEM MOOV AN "B" AN BOTH SAEM MOOV AN "b" AN ...
BOTH SAEM MOOV AN "C" AN BOTH SAEM MOOV AN "c" AN ...
BOTH SAEM MOOV AN "W" AN BOTH SAEM MOOV AN "w"
O RLY?, YA RLY
FOUND YR WIN
NO WAI
FOUND YR FAIL
OIC

I'm testing an application which is not exactly an e-commerce application but which behaves enough like one that you can think of it as an e-commerce application for the purposes of understanding this code :)
This code relies heavily on the Selenium Webdriver library.
The code comes from the P...

I guess abstract in this context is, classes that use SList do not bother of how insertEnd()/insertAt()/insertFront() work internally and the logice of these methods can be changed independently without effecting the users of this method.

> Starred messages appear in the room sidebar, ordered by number of stars and last time of starring. (Room owners can also pin messages, which permanently affixes them to the top of the room sidebar for up to 14 days.) The room sidebar is intended to be a collaboratively created mini-timeline of interesting room events for people who don't have time to read the entire chat transcript for that particular room.

Bug: n < 0 leads to you removing the last node.
Your solution should have comments: I have NO idea how it works. And that's after reading it a couple times. If this was production code, I'd have wrapped it with unit-tests, thrown the implementation away and rewrote it.

I found something that may interest you.
in one of my questions on Code Review I added in Stack Snippets to an old question and used the fun header formatting and it made parts of the stack snippet bigger because of where the comment for the begin snippet was located.
Just because snippets are ...

from Remove Nth Node from End of Linked List:
Bug: n < 0 leads to you removing the last node.
Your solution should have comments: I have NO idea how it works. And
that's after reading it a couple times. If this was production code,
I'd have wrapped it with unit-tests, thrown the impl...