Timeline for Hacker Rank: Extracting digits from a given number and check for divisibility
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 3, 2015 at 1:29 | comment | added | Dust_In_The_Wind |
you'll be able to invoke ArrayList specific methods and use ArrayList specific members in addition to those inherited from List. This is why I thought that maybe using ArrayList would give me access to use List methods too along with the ones from ArrayList. After reading your suggestions, I looked at the comments below the answer and realized that List is an interface and it's methods are basically ArrayList methods for both cases. I feel now the answer was somewhat misleading. Thanks for all your pointers. Also, the constraint says about range of N: 0 < N < 10 ^10 . That's why i used long.
|
|
Apr 3, 2015 at 1:27 | comment | added | Dust_In_The_Wind |
Thanks for your detailed answer, Tim! I have not yet read up on Lists, so wasn't able to use List specifically for this problem. But I did read up on Lists vs ArrayLists before writing my solution, and according to the answer on this SO problem, it says- When you define your list as: List myList = new ArrayList(); you can only call methods and reference members that belong to List class. If you define it as: ArrayList myList = new ArrayList();
|
|
Apr 2, 2015 at 21:30 | history | edited | tim | CC BY-SA 3.0 |
added 100 characters in body
|
Apr 2, 2015 at 21:25 | history | edited | tim | CC BY-SA 3.0 |
added 100 characters in body
|
Apr 2, 2015 at 21:18 | history | answered | tim | CC BY-SA 3.0 |