tag:blogger.com,1999:blog-2597841815280998418.post8680510762104051435..comments2024-03-12T06:45:01.935+01:00Comments on This Thread: Hackerrank Hash Tables: Ransom NoteMannyhttp://www.blogger.com/profile/07393063644320426727noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2597841815280998418.post-37312938512652706742018-05-18T16:15:02.499+02:002018-05-18T16:15:02.499+02:00This algorithm has linear time complexity with res...This algorithm has linear time complexity with respect to the biggest among N and M, being them the sizes of the two lists in input.<br /><br />The construction complexity of a Counter is linear on the size of the passed list, since we have to scan all the element in the list.<br />The for loop is linear on the size of ransom, since the get() cost on a hash table is constant in time.<br /><br />Mannyhttps://www.blogger.com/profile/07393063644320426727noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-28096790482247162882018-05-17T18:20:32.710+02:002018-05-17T18:20:32.710+02:00what would the big O complexity be?what would the big O complexity be?Anonymousnoreply@blogger.com