Timeline for Hackerearth Simple Function - Follow-up
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 6, 2018 at 3:01 | history | tweeted | twitter.com/StackCodeReview/status/1070513410830467072 | ||
Apr 13, 2017 at 12:40 | history | edited | Community Bot |
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
|
|
Jan 9, 2017 at 5:05 | comment | added | greybeard |
string with length from 1 to 1000 sure closely follows the wording from the original problem statement. I'd avoid Use [X] to express [Y] where X cannot be reconstructed from Y. Store digit i from 1 to 9 isn't quite what is happening - (record, denote,) represent absence of digit i with a zero at index i , its presence with a non-zero value (one/1?)? See my answer to the first iteration of your question for a representation of each basket using no more than 512 integers for any number of digit strings (and time complexity O(1) +O(n) input: "online algorithm").
|
|
Jan 9, 2017 at 0:11 | comment | added | Jianmin Chen | @gretbeard, the class HashedInteger's description has to be updated, ""Use an integer array to express an integer from 1 to 1000, array size is 10. Store digit i from 1 to 9 if there is any digit i in the integer.", should be written "Use an integer array to express a string with length from 1 to 1000 containing digits from 1 to 9, and the integer array size is 10. Store digit i from 1 to 9 if there is any digit i in the string." | |
Jan 9, 2017 at 0:07 | comment | added | Jianmin Chen | @greybeard, you are correct. I read problem statement again, the string length is in range of [1,1000]. Sample test case string in basket 1 are 234526 and 8345, both are more than 3 digits. Good catch! | |
Jan 8, 2017 at 22:52 | comment | added | greybeard |
There is a misunderstanding regarding the constraints: not the single number that each digit string could be interpreted as is limited by 1≤N1,N2≤1000 . The count of digit strings in basket1 is N1 (1, at least, and 1000, at most), the same limits apply to N2 , the count of digit strings in basket2. (That and the fact that you keep all strings before turning them into sets may be responsible for the memory usage of Input #1 .)
|
|
Jan 8, 2017 at 19:19 | history | edited | Jianmin Chen | CC BY-SA 3.0 |
change title from II to follow-up
|
Jan 8, 2017 at 5:12 | history | edited | Jianmin Chen | CC BY-SA 3.0 |
[Edit removed during grace period]
|
Jan 8, 2017 at 5:00 | history | edited | Jianmin Chen | CC BY-SA 3.0 |
add some results from hackerearth.com to be more specific, with supporting data.
|
Jan 8, 2017 at 4:17 | history | asked | Jianmin Chen | CC BY-SA 3.0 |