Timeline for Checking if a string contains all unique characters
Current License: CC BY-SA 4.0
26 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 27, 2022 at 21:00 | history | tweeted | twitter.com/StackCodeReview/status/1552398441778712578 | ||
| Jul 27, 2022 at 20:36 | answer | added | mdfst13 | timeline score: 1 | |
| Jul 23, 2020 at 17:00 | vote | accept | E-SetPrimeEpsilon | ||
| Jul 23, 2020 at 9:21 | history | rollback | Mast♦ |
Rollback to Revision 3
|
|
| Jul 23, 2020 at 9:21 | comment | added | Mast♦ | Please don't add/remove/modify code in your question once answers start coming in. | |
| Jul 23, 2020 at 9:19 | history | edited | E-SetPrimeEpsilon | CC BY-SA 4.0 |
added 853 characters in body
|
| Jul 22, 2020 at 23:15 | review | Suggested edits | |||
| Jul 23, 2020 at 0:14 | |||||
| Jul 22, 2020 at 19:16 | answer | added | Dorian Gray | timeline score: 6 | |
| Jul 22, 2020 at 15:43 | comment | added | pacmaninbw♦ | For those in the VTC queue, the edit should fix the question. | |
| Jul 22, 2020 at 15:41 | answer | added | Ralf Kleberhoff | timeline score: 1 | |
| Jul 22, 2020 at 15:18 | comment | added | E-SetPrimeEpsilon | Hey thanks so much for the feedback hopefully it should work now haha | |
| Jul 22, 2020 at 15:18 | history | edited | E-SetPrimeEpsilon | CC BY-SA 4.0 |
deleted 44 characters in body
|
| Jul 22, 2020 at 14:09 | history | edited | konijn |
edited tags
|
|
| Jul 22, 2020 at 14:08 | comment | added | konijn | Love the question, but I voted to close since this is not working code. Please update the question with working code (include tests!!) so that after we can vote to re-open | |
| Jul 22, 2020 at 13:56 | review | Close votes | |||
| Jul 23, 2020 at 5:37 | |||||
| Jul 22, 2020 at 13:55 | comment | added | slepic | Btw maybe if you iterate i from zero while < length-1 And j from i+1 while less then length, it would be easier to understand whats happening. There Is no reason why you would have to iterate backwards. It just makes it less intuitive IMO... | |
| Jul 22, 2020 at 13:52 | comment | added | slepic | Just fix your code, add more tests, and post a new question and include those tests too! | |
| Jul 22, 2020 at 13:51 | comment | added | slepic | Nope, then charAt(i) == charAt(j) would be true for i==j, but that does not make it duplicit... | |
| Jul 22, 2020 at 13:48 | comment | added | E-SetPrimeEpsilon | oh shoot, it should of been while(i<=j) correct. | |
| Jul 22, 2020 at 13:47 | comment | added | slepic |
while(i<j) if (i==j) ... Will never execute the body of the if.
|
|
| Jul 22, 2020 at 13:46 | comment | added | slepic | Try "ABB", your code only checks if the first character is duplicit, others are ignored. | |
| Jul 22, 2020 at 13:44 | comment | added | E-SetPrimeEpsilon | How so, I have tested the inputs "abcdefghijklmnopqrstuvwxyz", it worked, similarly if included duplicate characters it still worked. Am i missing something here | |
| Jul 22, 2020 at 13:37 | comment | added | slepic | Oh actually, your implementation Is O(n) but that's because It's flawed. It just does not do what you claim it does. That makes your question off topic here. Please test your code before posting the next time. | |
| Jul 22, 2020 at 13:29 | comment | added | slepic | Your implementation Is O(n^2) indeed. The sort approach would get you to O(n * log(n)). You can get to O(n) using a hashset. You can also do it in O(n) using an array of bools of size 256, which would effectively emulate a hashset for 1-byte characters. Not sure from what you wrote if you should not use data structures from standard library or if you are even asked to not implement them on your own... | |
| Jul 22, 2020 at 12:48 | review | First posts | |||
| Jul 22, 2020 at 13:21 | |||||
| Jul 22, 2020 at 12:44 | history | asked | E-SetPrimeEpsilon | CC BY-SA 4.0 |