ZgłośCodeWithWho@CodeWithWhoBuilding software that solves real problems. Software Engineer | Frontend | Backend Shipping ideas to the internet.https://t.co/coDfAjyBAeDołączył(a) marzec 2026158 Obserwowani97 Obserwujący934 PostyPostyMultimediaCodeWithWho@CodeWithWho·7moYesterday I wore an article on how my last week went Its is posted on LinkedInUdostępnijSkopiowano017247CodeWithWho@CodeWithWho·4dTaking every customer from one list and rescanning a huge second dataset each time works, but it scales badly. #softwareengineering #algorithms Watch:PobierzUdostępnijSkopiowano000CodeWithWho@CodeWithWho·4dIntersection means unique common values. If 3 is already in the result, another 3 should not be added again. #arrays #algorithms Watch:PobierzUdostępnijSkopiowano0003CodeWithWho@CodeWithWho·4dOnce A[i] matches something in B, existence is confirmed. Add it and stop scanning for that candidate. #algorithms #python Watch:PobierzUdostępnijSkopiowano0002CodeWithWho@CodeWithWho·4dOne value from A can force a full scan of B when no match exists. That's where repeated work begins. #algorithms #optimization Watch:PobierzUdostępnijSkopiowano0007CodeWithWho@CodeWithWho·4dBrute force: take one unique value from A, scan B for a match, add it if found, then repeat. #algorithms #arrays Watch:PobierzUdostępnijSkopiowano0005CodeWithWho@CodeWithWho·5dAlgorithm choice depends on data shape. 1M vs 1M and 100 vs 10M may deserve completely different strategies. #softwareengineering #algorithms Watch:PobierzUdostępnijSkopiowano00113CodeWithWho@CodeWithWho·5dn << m could mean 100 values vs 1,000,000. Same problem, very different data shape. #algorithms #optimization Watch:PobierzUdostępnijSkopiowano0007CodeWithWho@CodeWithWho·5dn ≈ m means roughly the same scale, not exactly equal. Example: 1,000 vs 1,200 elements. #algorithms Watch:PobierzUdostępnijSkopiowano0005CodeWithWho@CodeWithWho·5dIf the problem tells you the arrays are sorted, use that information. Sorted order can eliminate unnecessary work. #algorithms #optimization Watch:PobierzUdostępnijSkopiowano0005CodeWithWho@CodeWithWho·5dArray intersection = values that exist in both A and B, with no duplicates in the result. #algorithms #arrays Watch:PobierzUdostępnijSkopiowano0027CodeWithWho@CodeWithWho·6dBrute force remembers used positions. Hashing remembers remaining quantity. The better representation removes repeated discovery. #optimization #hashtables Watch:PobierzUdostępnijSkopiowano0004CodeWithWho@CodeWithWho·6dEvery character in L may scan all of M: O(l × m), or roughly O(n²) when both inputs are similar in size. #bigO #algorithms Watch:PobierzUdostępnijSkopiowano00017CodeWithWho@CodeWithWho·6dBrute force repeatedly searches M. Hashing builds inventory once and consumes it. Same answer, much less repeated work. #algorithms #hashtables Watch:PobierzUdostępnijSkopiowano0004CodeWithWho@CodeWithWho·7dCount already 0? Fail immediately. Same logic applies to stock, seats, credits and quotas in real systems. #softwareengineering #hashtables Watch:PobierzUdostępnijSkopiowano0027CodeWithWho@CodeWithWho·7dSecond 'a'? No search. Read char_count['a'], decrement, continue. That's the hash-table advantage. #optimization #hashtables Watch:PobierzUdostępnijSkopiowano0003CodeWithWho@CodeWithWho·7dLetter demand just decrements inventory: a 2→1, b 1→0. No magazine rescan. #algorithms #hashtables Watch:PobierzUdostępnijSkopiowano0007CodeWithWho@CodeWithWho·7dOptimized debugger: watch the current char and char_count. Those two values show supply being built and consumed. #python #debugging Watch:PobierzUdostępnijSkopiowano0001CodeWithWho@CodeWithWho·7dM='aabc' becomes a→2, b→1, c→1 in the debugger. Supply is built once before demand starts. #python #hashtables Watch:PobierzUdostępnijSkopiowano0002CodeWithWho@CodeWithWho·1wTicket inventory uses the same idea: Standard→120, VIP→15, then bookings consume the counts. Resource → quantity → demand. #softwareengineering Watch:PobierzUdostępnijSkopiowano0005CodeWithWho@CodeWithWho·1wCount already zero and demand asks for another unit? Fail immediately. No need to search for inventory we already know is gone. #hashtables #optimization Watch:PobierzUdostępnijSkopiowano0003
CodeWithWho@CodeWithWho·7moYesterday I wore an article on how my last week went Its is posted on LinkedInUdostępnijSkopiowano017247
CodeWithWho@CodeWithWho·4dTaking every customer from one list and rescanning a huge second dataset each time works, but it scales badly. #softwareengineering #algorithms Watch:PobierzUdostępnijSkopiowano000
CodeWithWho@CodeWithWho·4dIntersection means unique common values. If 3 is already in the result, another 3 should not be added again. #arrays #algorithms Watch:PobierzUdostępnijSkopiowano0003
CodeWithWho@CodeWithWho·4dOnce A[i] matches something in B, existence is confirmed. Add it and stop scanning for that candidate. #algorithms #python Watch:PobierzUdostępnijSkopiowano0002
CodeWithWho@CodeWithWho·4dOne value from A can force a full scan of B when no match exists. That's where repeated work begins. #algorithms #optimization Watch:PobierzUdostępnijSkopiowano0007
CodeWithWho@CodeWithWho·4dBrute force: take one unique value from A, scan B for a match, add it if found, then repeat. #algorithms #arrays Watch:PobierzUdostępnijSkopiowano0005
CodeWithWho@CodeWithWho·5dAlgorithm choice depends on data shape. 1M vs 1M and 100 vs 10M may deserve completely different strategies. #softwareengineering #algorithms Watch:PobierzUdostępnijSkopiowano00113
CodeWithWho@CodeWithWho·5dn << m could mean 100 values vs 1,000,000. Same problem, very different data shape. #algorithms #optimization Watch:PobierzUdostępnijSkopiowano0007
CodeWithWho@CodeWithWho·5dn ≈ m means roughly the same scale, not exactly equal. Example: 1,000 vs 1,200 elements. #algorithms Watch:PobierzUdostępnijSkopiowano0005
CodeWithWho@CodeWithWho·5dIf the problem tells you the arrays are sorted, use that information. Sorted order can eliminate unnecessary work. #algorithms #optimization Watch:PobierzUdostępnijSkopiowano0005
CodeWithWho@CodeWithWho·5dArray intersection = values that exist in both A and B, with no duplicates in the result. #algorithms #arrays Watch:PobierzUdostępnijSkopiowano0027
CodeWithWho@CodeWithWho·6dBrute force remembers used positions. Hashing remembers remaining quantity. The better representation removes repeated discovery. #optimization #hashtables Watch:PobierzUdostępnijSkopiowano0004
CodeWithWho@CodeWithWho·6dEvery character in L may scan all of M: O(l × m), or roughly O(n²) when both inputs are similar in size. #bigO #algorithms Watch:PobierzUdostępnijSkopiowano00017
CodeWithWho@CodeWithWho·6dBrute force repeatedly searches M. Hashing builds inventory once and consumes it. Same answer, much less repeated work. #algorithms #hashtables Watch:PobierzUdostępnijSkopiowano0004
CodeWithWho@CodeWithWho·7dCount already 0? Fail immediately. Same logic applies to stock, seats, credits and quotas in real systems. #softwareengineering #hashtables Watch:PobierzUdostępnijSkopiowano0027
CodeWithWho@CodeWithWho·7dSecond 'a'? No search. Read char_count['a'], decrement, continue. That's the hash-table advantage. #optimization #hashtables Watch:PobierzUdostępnijSkopiowano0003
CodeWithWho@CodeWithWho·7dLetter demand just decrements inventory: a 2→1, b 1→0. No magazine rescan. #algorithms #hashtables Watch:PobierzUdostępnijSkopiowano0007
CodeWithWho@CodeWithWho·7dOptimized debugger: watch the current char and char_count. Those two values show supply being built and consumed. #python #debugging Watch:PobierzUdostępnijSkopiowano0001
CodeWithWho@CodeWithWho·7dM='aabc' becomes a→2, b→1, c→1 in the debugger. Supply is built once before demand starts. #python #hashtables Watch:PobierzUdostępnijSkopiowano0002
CodeWithWho@CodeWithWho·1wTicket inventory uses the same idea: Standard→120, VIP→15, then bookings consume the counts. Resource → quantity → demand. #softwareengineering Watch:PobierzUdostępnijSkopiowano0005
CodeWithWho@CodeWithWho·1wCount already zero and demand asks for another unit? Fail immediately. No need to search for inventory we already know is gone. #hashtables #optimization Watch:PobierzUdostępnijSkopiowano0003